WebCustomRequestBin Function


Requests and reads a complete document specified by a URL using the specified HTTP method. The optional request body consists of binary data.

Include file



WebCustomRequestBin( in sMethod     : string,
                     in sUrl        : string,
                     in sData       : string,
                     in nDataLength : number optional,
                     in sContent    : string optional,
                     in formUrl     : form optional,
                     in fWait       : float optional): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sMethod HTTP method used for the request (like GET, POST, or M-GET).
sUrl Absolute URL to the file on the server. The entire character content of the query string will not be URL-encoded.
sData Data to post to the server. This may also be binary data. For posting all available binary data specify STRING_COMPLETE for nDataLength and use the bin() operator for sData (see example).
nDataLength Amount of the data that is posted to the server (in bytes). Specify STRING_COMPLETE or omit this parameter to post all available data.
sContent Content type string used in the request, for example, "image/gif" (optional). If this parameter is omitted, an "application/x-www-form-urlencoded" header is sent.

Form identifier used in the dclform section (optional). The expanded form string is appended to the URL after the "?". All unsafe characters are URL-encoded.

Set this parameter to FORM_NULL if you do not want to specify a form. You would do this when you want to specify the following parameters but want to omit this parameter.

fWait Minimum time or minimum mean time that this function call has to last (optional). The default value is 0.0.


  transaction TMain
    sData: string(4);
    SetLong(sData, 1, 15708);
    WebCustomRequest("GET", "http://standardhost/product.asp?code=2");
    WebCustomRequestBin("M-POST", "http://standardhost/main.asp",
      bin(sData), STRING_COMPLETE, "application/octet-stream", SHOPIT_PRODUCT_ASP002);
  end TMain;

    "code" := "2";