Empty HTTP response
Hi Guys,
We use the below code to send JSON file to one of our clients and was working fine but I think lately they did a windows update and now whenever we send file we aren't getting any HTTP responses, success or Error, just empty response ()
nothing has change from our end so why we aren't getting any HTTP response as all (see below)?
s Token=GetToken()
S FilePath="D:\CollectionGood_10733899.json"
Set File = ##class(%File).%New(FilePath)
Do File.Open("R")
Set Httprequest=##class(%Net.HttpRequest).%New()
Set Httprequest.SSLConfiguration="RTLS"
Set Httprequest.Server="url"
Set Httprequest.Timeout=30
Set Httprequest.Https=1
set Httprequest.ContentType="application/json"
Do Httprequest.SetHeader("Accept","*/*")
Do Httprequest.SetHeader("Authorization","Bearer "_Token)
do Httprequest.EntityBody.CopyFrom(File)
Set tSc=Httprequest.Post("/api/sensors/vibration")
Set StateCode=Httprequest.HttpResponse.StatusCode
Set status=Httprequest.HttpResponse.StatusLine
Set Resp=Httprequest.HttpResponse.Data.Read()
Q
Thanks
Hi.
What status (tSc) do you get?
Regards,
Matjaž
How to check the Status in tSc, tSc.StatusCode?
$SYSTEM.Status.GetErrorText(tSC) will work.
I get 0 followed by some gibberish as below, so I guess it's zero, which mean the post didn't go through, but how come it does from their portal (swagger) and our code use to work and we haven't change anything ?
Are you testing from same machine? Maybe the firewall is causing the problem?
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue