# ky - 작고 우아한 Fetch API 기반 Javascript HTTP Client

> Clean Markdown view of GeekNews topic #16078. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=16078](https://news.hada.io/topic?id=16078)
- GeekNews Markdown: [https://news.hada.io/topic/16078.md](https://news.hada.io/topic/16078.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2024-07-30T09:44:02+09:00
- Updated: 2024-07-30T09:44:02+09:00
- Original source: [github.com/sindresorhus](https://github.com/sindresorhus/ky)
- Points: 9
- Comments: 3

## Summary

ky는 최신 브라우저와 Node.js/Bun/Deno에서 사용할 수 있는 간단하고 우아한 Fetch API 기반의 Javascript HTTP 클라이언트입니다. 이 클라이언트는 더 간단한 API, 실패한 요청 재시도, 타임아웃 지원 등 fetch보다 개선된 기능을 제공합니다. 또한, TypeScript와의 호환성을 통해 더욱 안전하고 효율적인 코딩이 가능합니다.

## Topic Body

- 최신 브라우저 및 Node.js/Bun/Deno 용   
- fetch 보다 나은 점   
  - 더 간단한 API   
  - 숏컷 메소드 (`ky.post()`)  
  - 2xx 가 아닌 상태코드를 에러로 처리(리다이렉트후)  
  - 실패한 요청 재시도   
  - JSON 옵션   
  - 타임아웃 지원   
  - URL Prefix 옵션   
  - 커스텀 디폴트 값을 가지는 인스턴스   
  - Hooks   
  - TypeScript의 장점들 (`.json()` 은 `any`가 아니라 `unknown` 으로. `.json&lt;T&gt;()`도 사용 가능 )

## Comments



### Comment 27734

- Author: tested
- Created: 2024-08-01T11:23:58+09:00
- Points: 1

sindresorhus의 모듈들은 ESM 설정을 강요하던데 이것도 그렇군요

### Comment 27683

- Author: [hidden]
- Created: 2024-07-30T10:49:33+09:00
- Points: 1

[숨김 처리된 댓글입니다]

### Comment 27681

- Author: ilotoki0804
- Created: 2024-07-30T10:13:10+09:00
- Points: 1

[requests](https://requests.readthedocs.io/en/latest/)와 API가 거의 흡사하네요. 거기에서 영감을 받았나 봅니다.
