post
Sets the request body as JSON and changes the HTTP method to POST.
This method automatically:
Sets the HTTP method to POST
Sets Content-Type header to "application/json"
Serializes the JSON object as the request body
Note: Calling this method will change the HTTP method to POST if not already set. Use put if you need a PUT request with JSON body.
Parameters
The JSON object to set as the body.
See also
For PUT requests with JSON body.
For form-encoded POST requests.
Sets the request body with POST method and custom content type.
This method allows specifying a custom Content-Type header along with the body content as a string. Useful for sending non-JSON payloads like XML, plain text, or other custom formats.
Parameters
The Content-Type header value (e.g., "text/plain", "application/xml").
The request body as a string.
See also
For JSON POST requests.