InfoGrab DocsInfoGrab Docs

노드 빌더를 위한 HTTP request 헬퍼

노드 빌더를 위한 HTTP request 헬퍼 사용법과 새 헬퍼로의 마이그레이션 방법을 설명합니다.

n8n은 대부분의 복잡성을 추상화하여 HTTP 요청을 만들 수 있는 유연한 헬퍼를 제공합니다. Note 프로그래매틱 스타일 전용 이 문서의 정보는 프로그래매틱 스타일을 사용하는 노드 빌드에만 해당합니다. 선언적 스타일 노드에는 적용되지 않습니다. 사용법 # execute 함수 내부에서 헬퍼를 호출합니다. // If no auth needed const response = await this . helpers . httpRequest (options); // If auth needed const response = await this . helpers . httpRequestWithAuthentication . call ( this , 'credentialTypeName' , // For example: pipedriveApi options, ); options 는 객체입니다. { url : string ; headers ?: object ; method ?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' ; body ?: FormData | Array | string | number | object | Buffer | URLSearchParams ; qs ?: object ; arrayFormat ?: 'indices' | 'brackets' | 'repeat' | 'comma' ; auth ?: { username : string , password : string , }; disableFollowRedirect ?: boolean ; encoding ?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' ; skipSslCertificateValidation ?: boolean ; returnFullResponse ?: boolean ; proxy ?: { host : string ; port : string | number ; auth ?: { username : string ; password : string ; }, protocol ?: string ; }; timeout ?: number ; json ?: boolean ; } url 은 필수입니다. 다른 필드는 모두 선택 사항입니다. 기본 메서드는 GET 입니다. 가능한 필드에 대한 몇 가지 참고 사항입니다. body : JSON 페이로드에는 일반 JavaScript 객체를, 파일 업로드에는 버퍼를, multipart/form-data 에는 FormData 인스턴스를, application/x-www-form-urlencoded 에는 URLSearchParams 를 사용할 수 있습니다. headers : 키-값 쌍입니다. body 가 FormData 의 인스턴스인 경우 n8n이 자동으로 content-type: multipart/form-data 를 추가합니다. body 가 URLSearchParams 의 인스턴스인 경우 n8n이 content-type: application/x-