Web API - Requesting data from services
Posted: Mon Aug 29, 2022 6:46 pm
Hi,
thanks to Dino I have a nice example to test if our IBMi is connected to the net and can request something from URLs.
Function Options(*DIRECT)
Define_Com Class(#XPRIM_HttpRequest) Name(#Request) Scope(*Application)
#Request.DoPost Url('https://www.google.com')
If (#Request.Response.IsSuccessfulRequest)
Message Msgtxt(allgood)
Else
Message Msgtxt(notgood)
Endif
When using 'https://www.google.com' the response is "allgood".
But when I replace 'https://www.google.com' with 'https://www.lansa.com' or our web page 'https://www.smhsoftware.de' I always get response "notgood".
Why is this so?
What has to be done to get "allgood" when using other URLs than 'https://www.google.com'?
Kind regards,
Joerg
thanks to Dino I have a nice example to test if our IBMi is connected to the net and can request something from URLs.
Function Options(*DIRECT)
Define_Com Class(#XPRIM_HttpRequest) Name(#Request) Scope(*Application)
#Request.DoPost Url('https://www.google.com')
If (#Request.Response.IsSuccessfulRequest)
Message Msgtxt(allgood)
Else
Message Msgtxt(notgood)
Endif
When using 'https://www.google.com' the response is "allgood".
But when I replace 'https://www.google.com' with 'https://www.lansa.com' or our web page 'https://www.smhsoftware.de' I always get response "notgood".
Why is this so?
What has to be done to get "allgood" when using other URLs than 'https://www.google.com'?
Kind regards,
Joerg