TsgcHTTP3Client › Methoden › Post
Verstuurt een synchrone HTTP/3 POST-aanvraag met een berichttekst en retourneert de antwoordtekst.
function Post(const aURL: string; const aData: string; const aContentType: string = 'application/x-www-form-urlencoded'): string;
| Naam | Type | Beschrijving |
|---|---|---|
aURL | const string | Absolute URL van de resource waarnaar het verzoek wordt verstuurd. |
aData | const string | Aanvraagberichttekst die naar de server wordt verstuurd. |
aContentType | const string | Waarde van de content-type-header. Standaardwaarde is application/x-www-form-urlencoded. |
Antwoordbody ontvangen van de server, gedecodeerd als een string. (string)
Post blokkeert de aanroepende thread totdat het volledige HTTP/3-antwoord is ontvangen en retourneert de body als een string. Stel aContentType in op de payload, bijvoorbeeld application/json bij het versturen van een JSON-document. Gebruik voor niet-blokkerende verzoeken PostAsync, dat het antwoord levert via OnResponse.
vResponse := oClient.Post('https://api.example.com/v1/login', 'user=john&pass=secret');