API GET Method returns 404

Hi Guys, could you please help us with this query? we are using katalon v 7 and doing a rest api testing using the following URL and returns 404:

URL: https://sf.vacancy-filler.co.uk/CareerPage/GetItem?callback=jQuery34109979038039849806_1572518090014&id=ckjnB3fhCjukXbca%2BWeiVA%3D%3D
Method: GET

If I use postman, the same api returns 200 and works fine.

is it a bug in katalon or I am missing something in the setup?

open postman console, make the request and check what headers postman is sending (he is doing some automaticaly filling). could be that you miss a certain header in katalon therefore the 404.
also check the .har generated by katalon to see what it was actualy sending with the request and compare with the above.

Thanks for your reply. I have tried using the same headers from the postman and now I get a 400 bad request… I HAR file

{
“log” : {
“version” : “1.2”,
“pages” : [ ],
“entries” : [ {
“startedDateTime” : “2019-11-01T11:47:52.813Z”,
“request” : {
“method” : “GET”,
“url” : “https://sf.vacancy-filler.co.uk/CareerPage/GetItem?callback=jQuery34109979038039849806_1572518090014&id=ckjnB3fhCjukXbca%2BWeiVA%3D%3D”,
“httpVersion” : “”,
“cookies” : [ ],
“headers” : [ {
“name” : “Connection”,
“value” : “keep-alive”
}, {
“name” : “Accept-Encoding”,
“value” : “gzip”
}, {
“name” : “Accept”,
“value” : “/
}, {
“name” : “Host”,
“value” : “https://sf.vacancy-filler.co.uk
} ],
“queryString” : [ {
“name” : “callback”,
“value” : “jQuery34109979038039849806_1572518090014”
}, {
“name” : “id”,
“value” : “ckjnB3fhCjukXbca+WeiVA==”
} ],
“headersSize” : 0,
“bodySize” : 0,
“comment” : “”
},
“response” : {
“status” : 400,
“statusText” : “”,
“httpVersion” : “”,
“cookies” : [ ],
“headers” : [ {
“name” : “X-Cache”,
“value” : “Error from cloudfront”
}, {
“name” : “Server”,
“value” : “CloudFront”
}, {
“name” : “X-Amz-Cf-Pop”,
“value” : “LHR52-C1”
}, {
“name” : “Connection”,
“value” : “close”
}, {
“name” : “X-Amz-Cf-Id”,
“value” : “4dtiWB33Bp-gGfgU4DxVTpdffZ_yYx21y_PTmGT2yLnwbaLJdZF2Fg==”
}, {
“name” : “#status#”,
“value” : “HTTP/1.1 400 Bad Request”
}, {
“name” : “Content-Length”,
“value” : “915”
}, {
“name” : “Date”,
“value” : “Fri, 01 Nov 2019 11:47:53 GMT”
}, {
“name” : “Content-Type”,
“value” : “text/html”
}, {
“name” : “Via”,
“value” : “1.1 ebcb649503fb1051ac327331110822d4.cloudfront.net (CloudFront)”
} ],
“content” : {
“size” : 915,
“mimeType” : “text/html”,
“text” : “\n<META HTTP-EQUIV=“Content-Type” CONTENT=“text/html; charset=iso-8859-1”>\nERROR: The request could not be satisfied\n\n

400 ERROR

\n

The request could not be satisfied.

\n<HR noshade size=“1px”>\nBad request.\nWe can’t connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n<BR clear=“all”>\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n<BR clear=“all”>\n<HR noshade size=“1px”>\n
\nGenerated by cloudfront (CloudFront)\nRequest ID: 4dtiWB33Bp-gGfgU4DxVTpdffZ_yYx21y_PTmGT2yLnwbaLJdZF2Fg==\n
\n\n\n”,
“comment” : “”
},
“redirectURL” : “”,
“headersSize” : 284,
“bodySize” : 915,
“comment” : “”
},
“cache” : { },
“timings” : {
“comment” : “”,
“ssl” : -1,
“blocked” : -1,
“connect” : 75,
“send” : 0,
“wait” : 0,
“receive” : 0,
“dns” : -1
},
“comment” : “”,
“_katalonRequestInformation” : {
“name” : “28”,
“testObjectId” : “C:\Users\amol.aridas\Katalon Studio\Smartfeeds\Object Repository\LIVE\GetItem - Copy.rs”,
“harId” : “6929e9ae-ce15-43a1-9d74-2004ed224e29”,
“reportFolder” : null
},
“time” : 75
} ],
“comment” : “”
}
}

mhm … worked for me in 6.3.3 without any particular header … so check carefully if the url is right:
(or it can be an issue in v7)

ok. so this is an issue in the version 7.0.4 of Katalon… thanks for your support

Hi @qa110,
From version 7.0.0, Katalon will automatically escape special characters in query parameters before sending the request. Therefore, if any of your query parameters has been escaped before, it will be escaped again and cause your query parameter to be incorrectly decoded when being received at the server. That is the reason for the 404 not found as your “id” query parameter has been escaped in advance. To fix the issue, please change the value of your “id” query parameter to unescaped form and try again with Katalon version 7.0.6.
Regards.

1 Like

Perfect. Thanks for the feedback. I had to change the parameter from having the % to == ckjnB3fhCjukXbca+WeiVA== and it worked.

This query can now be closed

@devalex88 told you, other users are affected too :slight_smile: