TsgcHTTP2ClientYöntemler › PatchAsync

PatchAsync Yöntem

Engelleme yapmayan bir HTTP/2 PATCH gönderir; yanıt OnHTTP2Response'da eşzamansız olarak teslim edilir.

Sözdizimi

procedure PatchAsync(const aURL: string; const aSource: TStream);

Parametreler

NameTypeAçıklama
aURLconst stringKısmen güncellenecek kaynağın mutlak URL'si.
aSourceconst TStreamPatch belgesini tutan akış (örneğin bir JSON Patch veya JSON Merge Patch gövdesi).

Remarks

Patch öğesinin engellemeyen (non-blocking) varyantı. İsteği teslim için kuyruğa alır ve hemen döner; sunucu yanıtı uygulamaya OnHTTP2Response aracılığıyla ulaşır. Çağrıdan önce Request.ContentType öğesini geçerli bir patch medya türüne ayarlamayı unutmayın.

Örnek

oClient.OnHTTP2Response := OnHTTP2ResponseEvent;
oBody := TStringStream.Create('{"email":"new@example.com"}');
try
  oClient.Request.ContentType := 'application/merge-patch+json';
  oClient.PatchAsync('https://api.example.com/users/42', oBody);
finally
  oBody.Free;
end;

Yöntemlere Dön