wwHTTP::cContentType

Optional content type for POST data that is sent to the server.

Set this value if you're posting raw POST buffers for data like JSON or XML.

o.cContentType

Remarks

This property is only applied if nHttpPostMode is set to a value other than 1 or 2.

Example

*** Send JSON data to a REST service
loHttp = CREATEOBJECT("wwHttp")

*** Specify the data sent is JSON
loHttp.cContentType = "application/json"

*** POST the raw JSON data
lcJSON = serializer.Serialize( loData )
loHttp.AddPostKey(lcJson)

lcResponse = loHttp.HttpGet(lcUrl)

See also:

West Wind Web Connection | wwHTTP::nhttppostmode | wwHTTP::AddPostKey

© West Wind Technologies, 1996-2019 • Updated: 02/11/15
Comment or report problem with topic