Making a web request failing


#1

1) Give a description of the problem
im trying to do web request to retrieve a JSON response.
I have tested the URL and headers in postman and it works, retrieves a JSON output format correctly.
putting the same URL and headers into a web request and it fails with an error.
Type : Make a web request.
URL expression :frowning:accountId is a valid Id i have obfuscated)
https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/accountID/vehicles?country=GB
Method : Get
Send Variables : none
Header: (both obfuscated but valid)
“‘apikey: “KAMEREON_API_KEY”’,‘x-gigya-id_token: “x_gigya_id_token”’”
i have tried both of the above as Auth Headers as well but none seem to make any difference.
also just tried the same thing on https://reqbin.com/ and it works fine.
*note the x-gigya-id_token is a string variable with the value of a JWT token.

2) What is the expected behaviour?
JSON response should be returned and attributes available under the $response variable.

  • but the http response is failing.

3) What is happening/not happening?
“Error executing external web request: groovyx.net.http.HttpResponseException: Unauthorized”

**4) Post a Green Snapshot of the piston!
i could post an image, but the make a web request in the main piston view doesnt show all the options only the main URL and method type.

5) Attach logs after turning logging level to Full
log extract… - i have just included the part where he web request is made and obfuscated the account ID… - should the header options be shown in this log ?

+800ms ║║Sending external web request to: api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/accountID/vehicles?country=GB
+848ms ║║Error executing external web request: groovyx.net.http.HttpResponseException: Unauthorized
+849ms ║║Executed virtual command httpRequest (51ms)

#2

to follow up on this, ive setup a mock server on postmans webservice, and attempted several web requests using the json and form types… oddly neither seem to be passing through the headers at all…

A test request to pass through 2 variables in the body and auth header…

but postman doesnt receive either and throws up an error reporting something went wrong

checking back in webcore logging…

+765ms ║║Sending external web request to: a3e4b927-9055-45b9-b914-47cfb4f3a716.mock.pstmn.io
+1198ms ║║Error executing external web request: groovyx.net.http.HttpResponseException: Not Found

Help!.. something seems to be broken in webcores make a web request function.


#3

Can you encode the key as parameters rather than in the header to see if that works? How do you do it when you test externally? I often copy the URL and paste it in a browser window. When that works, I know it will work in WebCoRE.


#4

It looks like you need to use custom headers. You probably ought to read this: