reqwest.method
reqwest.method
Function
Set the HTTP request method.
Syntax
reqwest(url).method(method)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| method | String | No | GET | HTTP method, will be converted to uppercase. |
Return value
| Type | Description |
|---|---|
| Reqwest | Returns the new request builder. |
Example
request = reqwest('https://example.com').method('post') result = type(request) // Output: Reqwest print result
Notes
- The method name will be verified by reqwest::Method when sending().