Name
easy:Send -- sends raw data over an easy connection
Synopsis
sent = easy:Send(data$)
Function
This function sends arbitrary data over the established connection. You may use it together with easy:Recv() 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. You need to pass the data to send in data$. This can also contain binary data.

To establish the connection, set #CURLOPT_CONNECT_ONLY option before calling easy:Perform() or multi:Perform(). Note that easy:Send() will not work on connections that were created without this option.

The call will return -1 if it's not possible to send data right now. In that case, you need to try to send the data again because curl uses non-blocking sockets.

Furthermore easy:Send() may return -1 if the only data that was sent was for internal SSL processing, and no other data could be sent.

Inputs
data$
data to send
Results
sent
number of bytes sent

Show TOC