by cdmmaui » Tue Dec 06, 2022 1:43 pm
Thank you Marc.
Is there a sample for HTTPS connection to retrieve the JSON data or can I use code below?
TRY
oHttp := CreateObject( 'MSXML2.XMLHTTP' )
CATCH
oHttp := CreateObject( 'Microsoft.XMLHTTP' )
END
TRY
oHttp:Open( "GET", cUrl, .F.)
oHttp:SetRequestHeader( "KeyId", "xxx" )
oHttp:SetRequestHeader( "Accept", "*/*" )
oHttp:SetRequestHeader( "Content-Type", "application/json" )
oHttp:Send()
oHttp:waitForResponse()
IF oHttp:Status == 200
Sysrefresh()
cWinResp := oHttp:ResponseBody
MsgAlert( cWinResp, Ptitle )
ENDIF
CATCH oError
MsgAlert( oError:Description, Ptitle )
RETURN (.F.)
END