Hi, i am fivewin/xharbour programmer and i am trying to capture the response from an http request ( i need to send an address and obtain the POSTAL ITALIAN CODE).
I tried this
Function http(therequest)
Local oHttp
default therequest:= "https://www.nonsolocap.it/cap?k=calori&b=&c=bologna"
Try
* oHttp := CreateObject( "winhttp.winhttprequest.5.1" )
oHttp:= CreateObject("Microsoft.XMLHTTP")
Catch
MsgInfo("errore connessione msxml2, uso microsoft ")
oHttp := CreateObject( 'Microsoft.XMLHTTP' )
End
oHttp:Open( 'GET', therequest, .F. )
oHttp:SetRequestHeader( "Content-Type","application/json")
oHttp:Send()
Try
cResp := oHttp:ResponseBody
Catch
MsgInfo("errore responsebody")
End
*oHttp:SetRequestHeader( "Content-Type","application/json")
SysRefresh()
MsgInfo(cResp)
Return
But i get the error from oHttp:ResponseBody : cresp does not exist
Can anyone help me??
lorenzoazz