Sock.Httprqstring R/O Property

Top  Previous  Next

 

Function:

For the selected socket (selection is made through sock.num) returns up to 255 bytes of the HTTP request string stored in the VAR buffer.

Type:

String

Value Range:

Default= ""

See Also:

Sock.varbuffrq, sock.varlen

 


Details

The sock.httprqstring is a property; it can be invoked several times and will return the same data (when this property is used the data is not deleted from the VAR buffer). VAR buffer contents are explained in Details on Variable Data.

This property is only relevant when the socket is in the HTTP mode (sock.httpmode= 1- YES). Use it from within an HTML page or on_sock_postdata event handler. Maximum length of data that can be obtained through this property is 255 bytes, since this is the maximum possible capacity of a string variable that will accept the value of the sock.httprqstring.

HTTP requests can be much longer than 255 bytes and can even include entire files being uploaded from the client to your device. Rely on the on_sock_postdata event and the sock.gethttprqstring method to handle large amounts of HTTP variable data correctly.

 

note_warning-wt

If you are using the sock.httprqstring, and if the client sends more data than can fit in the VAR buffer, the execution of the HTTP request will be stalled indefinitely. To avoid this, reply on the on_sock_postdata event and the sock.gethttprqstring method, as explained in Complex Case (Large Amount of Variable Data).