TsgcHTTP3Client › 메서드 › Put
본문 페이로드와 함께 동기식 HTTP/3 PUT 요청을 보내고 응답 본문을 반환합니다.
function Put(const aURL: string; const aData: string; const aContentType: string = 'application/json'): string; overload;
procedure Put(const aURL: string; const aSource: TStream; const aResponseContent: TStream); overload;
| Name | Type | 설명 |
|---|---|---|
aURL | const string | 요청이 전송되는 리소스의 절대 URL입니다. |
aData | const string | 서버로 전송되는 요청 본문. |
aContentType | const string | content-type 헤더의 값입니다. 기본값은 application/json입니다. |
aSource | TStream | 요청 본문으로 전송할 내용의 스트림(스트림 오버로드 전용). |
aResponseContent | TStream | 원시 응답 본문을 수신하는 스트림(스트림 오버로드 전용). |
서버에서 수신한 응답 본문(문자열로 디코딩됨). 스트림 오버로드는 본문을 aResponseContent에 씁니다. (string)
Put은 전체 HTTP/3 응답을 받을 때까지 호출 스레드를 차단합니다. 문자열 본문을 전송하려면 첫 번째 오버로드를 사용하고 aContentType을 페이로드에 맞게 설정하십시오. TStream에서 요청 본문을 전송하고 다른 스트림에 응답을 쓰려면 스트림 오버로드를 사용하십시오. 논블로킹 요청을 사용하려면 PutAsync를 사용하면 OnResponse에 응답이 전달됩니다.
vResponse := oClient.Put('https://api.example.com/v1/users/42', '{"name":"john"}');