Topics
All
Mac OS X
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Guides
Examples
New in version:
7.4
7.5
8.0
8.1
8.2
8.3
8.4
8.5
9.0
9.1
Statistic
CURL.SendText
Sends raw data with text over a connection.
Component | Version | macOS | Windows | Server | FileMaker Cloud | FileMaker iOS SDK |
CURL | 7.2 | Yes | Yes | Yes | Yes | Yes |
Parameters
Parameter | Description | Example value |
---|---|---|
curl | The CURL session handle. | $curl |
Text | The text to send. | |
Encoding | Optional The text encoding for text parameter. Default is UTF-8. Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform. |
"UTF8" |
Result
Returns OK or error.
Description
Sends raw data with text over a connection.This function sends arbitrary data over the established connection. You may use it together with ReceiveData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
Provide the data to send via parameter. We return the number of bytes sent.
To establish the connection, use CURL.SetOptionConnectOnly with value 1 before calling CURL.Perform function. Note that SendData will not work on connections that were created without this option.
The call will return empty and set error to CURLE_AGAIN (81) if it's not possible to send data right now - the socket is used in non-blocking mode internally. When CURLE_AGAIN is returned, please wait.
Furthermore if you wait on the socket and it tells you it's writable, SendData may return CURLE_AGAIN if the only data that was sent was for internal SSL processing, and no other data could be sent.
Please use CURL.ErrorCode to query error after you used this function.
Examples
Send HTTP request:
Set Variable [$request; Value:"GET / HTTP/1.1¶Host: www.monkeybreadsoftware.de¶¶" // must end with two empty lines ]
Set Variable [$request2; Value:MBS( "Text.ReplaceNewline"; $request; 3)]
Set Variable [$r; Value:MBS( "CURL.SendText"; $curl; $request2; "UTF-8")]
See also
- CURL.ErrorCode
- CURL.Perform
- CURL.SetOptionConnectOnly
- Socket.SSL.Connect
- Socket.SSL.Initialize
- Text.ReplaceNewline
Example Databases
Blog Entries
Created 27th March 2017, last changed 10th April 2017
CURL.SendData - CURL.SetBatchDestinationPath
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos