Question
· Jul 24

"Bad request error" making API request.

Hi,

I'm making a request to an API that works perfectly with Postman, you can see it here:

The URL is https://testcds.esriguide.org/v2/session/3189981 where the last part is the ID's session I want to get back.

When I try to make the same request in IRIS I always get a "Bad request" error.

I'm creating the request which all the information needed (or at least that I know):

Method TornaRequestGET() As %Net.HttpRequest

{
Set request = ##class(%Net.HttpRequest).%New()
Set request.SSLConfiguration = "iGUIDE"
Do request.SetHeader("Authentication",..#AuthenticationAPIKEY)
Do request.SetHeader("Accept","application/json")
Set request.HTTPVersion = "HTTP/2.0"
Set request.Https = 1

}

I make the request with:
..SendFormDataArray(.pHttpResponse, "GET", ..TornaRequestGET(), .pFormVarNames, .pData, pURL)

I always get the same error: "HTTP/1.1 400 Bad Request".

Can anyone help me please?

Thanks in advance.

Product version: IRIS 2022.1
Discussion (2)2
Log in or sign up to continue