<cUrl_Http>.Body

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > CURL > cUrl_Http > <cUrl_Http> Request Properties >

<cUrl_Http>.Body

 

Description

 

Get / Set HTTP request body.

 

Syntax

 

' GET

payload = <cUrl_Http>.Body

 

' SET

<cUrl_Http>.Body = payload

 

Returns

 

String containing the value of body in cUrl_Http request.

 

Parameters

 

Name

Type

Optional

Meaning

payload

String

Yes

Any string data to be passed to request

 

Remarks

 

Any double quotes will be correctly escaped for curl command automatically.

 

Can be used to send JSON payload, for example.

 

Restrictions

 

See also

 

Examples

 

uses "curl", "console"

 

Dim httpRequest As New cUrl_Http

 

httpRequest.Url  = "https://www.thinbasic.com"

httpRequest.Body = "{""message"": ""Ciao!""}"

printl httpRequest.Body    ' Will print {"message": "Ciao!"}

printl httpRequest.Preview ' Will return "--request GET -d "{\"message\": \"Ciao!\"}" http://www.thinbasic.com" for this case