Currently I use the process for interacting with a website, and then decoding a response in JSON. Here is a cutdown version of the fuction:
- Code: Select all Expand view
Function PostTo360( cUrl, cData, cContentType,cAuthorization )
Local oOle,cRet:='',uRet
default cContentType:="application/json"
default cAuthorization:=""
oOle := CreateObject( "MSXML2.XMLHTTP" )
oOle:Open( 'GET', cUrl, .f. )
oOle:SetRequestHeader( "Content-Type", cContentType)
oOle:SetRequestHeader( "Authorization",cAuthorization)
oOle:Send( cData )
cRet := oOle:ResponseBody
RETURN( cRet )
This works perfectly with most of my vendors. cURL is the website, and once opened, I send the Parameters ( cData ). cRet contains the value which I pass as a hash to decode. There is NO PROBLEM with this, except with one vendor. They just changed their API, and although this method worked before, it is not now working. It appears it is not properly getting the cData passed.
He wants me to pass the url and data as a single string to the https:// site, and get a return value.
- Code: Select all Expand view
https://theirsite.force.com/abcompany/services/apexrest/pairTerminal?abcompanyId=0013r03102frFDOAA2&terminalId=1111&DeviceLabel=TEST123
Can someone provide a sample for sending the full string rather than the process we normally use ? I need to save the response to a variable.
Thank you.