메인 콘텐츠로 건너뛰기
Node.js와 브라우저 환경에서 모두 동작하는 범용 HTTP 클라이언트

생성자

constructor

new HttpClient(): HttpClient

반환값

HttpClient

정의된 위치

http-client.ts:43

메서드

createHeaders

createHeaders(init?): Headers 새 Headers 인스턴스를 생성합니다

매개변수

이름type
init?Record<string, string>Headers

반환값

Headers

정의된 위치

http-client.ts:99

request

request(url, options?): Promise<HttpResponse> HTTP 요청을 보냅니다

매개변수

이름타입
urlstring
optionsHttpClientRequestOptions

반환

Promise<HttpResponse>

정의 위치

http-client.ts:106

get

get(url, headers?): Promise<HttpResponse> GET 요청을 보냅니다

매개변수

이름type
urlstring
headers?Record<string, string>

반환값

Promise<HttpResponse>

정의 위치

http-client.ts:141

post

post(url, body?, headers?): Promise<HttpResponse> POST 요청을 보냅니다

매개변수

이름type
urlstring
body?string
headers?Record<string, string>

반환

Promise<HttpResponse>

정의 위치

http-client.ts:151

put

put(url, body?, headers?): Promise<HttpResponse> PUT 요청을 수행합니다

매개변수

이름type
urlstring
body?string
headers?Record<string, string>

반환

Promise<HttpResponse>

정의 위치

http-client.ts:162

delete

delete(url, headers?): Promise<HttpResponse> DELETE 요청을 보냅니다

매개변수

이름type
urlstring
headers?Record<string, string>

반환

Promise<HttpResponse>

정의된 위치

http-client.ts:173

patch

patch(url, body?, headers?): Promise<HttpResponse> PATCH 요청을 수행합니다

매개변수

이름type
urlstring
body?string
headers?Record<string, string>

반환

Promise<HttpResponse>

정의된 위치

http-client.ts:183