Meet us at at Real World in Orlando, Florida.
All functions
Mac OS X
Windows
Crossplatform
Components
Guides
New in version:
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
CURL.SetOptionCustomRequest
Component: CURL
Version: 2.5
Mac OS X: Works
Windows: Works
MBS( "CURL.SetOptionCustomRequest"; handle; value )
Parameters
| Parameter | Description | Example value |
|---|---|---|
| Handle | The CURL session handle. | $curl |
| Value | The custom request string. | "PUT" |
Result
Returns "OK" on success.
Description
Sets a custom request.Pass a text string as parameter. It will be used instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST when doing a FTP directory listing. This is useful for doing DELETE or other more or less obscure HTTP requests. Don't do this at will, make sure your server supports the command first.
When you change the request method by setting CURL.SetOptionCustomRequest to something, you don't actually change how libcurl behaves or acts in regards to the particular request method, it will only change the actual string sent in the request.
For example: if you tell libcurl to do a HEAD request, but then change the request to a "GET" with CURL.SetOptionCustomRequest you'll still see libcurl act as if it sent a HEAD even when it does send a GET.
To switch to a proper HEAD, use CURL.SetOptionNoBody, to switch to a proper POST, use CURL.SetOptionPost or CURL.SetOptionPostFields and so on.
Restore to the internal default by setting this to NULL.
Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use CURL.SetOptionPost and CURL.SetOptionPostFields to set POST data. Use CURL.SetOptionHTTPHeader to replace or extend the set of headers sent by libcurl. Use CURL.SetOptionHTTPVersion to change HTTP version.
Feedback: Report problem or ask question.
Links
MBS Realbasic Chart Plugins - Förderverein St. Arnulf Nickenich