Ask a Question

API Works on Postman- Imported Request to Ready API Doesnt work

SOLVED
smynam
New Contributor

API Works on Postman- Imported Request to Ready API Doesnt work

Hi 
My API woks in Postman it is a simple get request, under authorization tab passing in credentials [username & password] and default headers - 

In Readyapi imported the collection through the integration tab , no luck with ready api, using the authorization tab from the root level [parent level] added the authorization using the basic auth - still no luck

 

could you please fill in what i am missing

 

6 REPLIES 6
richie
Community Hero

Hey @smynam 

 

we're gonna need more info to help.

 

when you say "no luck" - what actually happens?  are you getting a response but with a 400 series response code?  (e.g. 400 bad request? 401 unauthorized?), no response?

 

what does it say in the ReadyAPI! log and the Errors log?

 

cheers,

 

rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
smynam
New Contributor

HTTP/1.1 405 Method Not Allowed
Date: Wed, 09 Sep 2020 13:48:20 GMT
Content-Length: 0
Connection: keep-alive
x-amz-cognito-request-id: 6caf1366-167e-40b4-b1a5-0fdd653ca52e
X-Application-Context: application:prod:8443
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Server: Server
Allow: GET

 

content type : null

richie
Community Hero

Hey @smynam 

 

you got a 405 - that's method not allowed meaning you tried using a method that isn't supported by the API you're poking.

 

This is REST - not SOAP - right? - you tend to have less control wiht the methods with SOAP than REST.

 

SO! - you have a 405 at the top of the RAW response and at the bottom you have an 'Allow' header and this indicates the methods that are supported by the endpoint you are hitting.

 

Are you sure you did the request using a GET method?  According to the response header details you're getting, I'd suggest you used a different method - not a GET....maybe a POST?

 

have a look at the following pic - you can see the Method value is defined as GET here.

 

If you are definitely submitting a GET request against your endpoint, I'd suggest there's a defect with endpoint itself, but I wouldn't expect this.

 

ta

 

rich

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
sonya_m
SmartBear Alumni (Retired)

Thank you for helping Richie!

 

Hi @smynam ! Please note that you replied straight to the automatic email notification - this way your reply won't reach the Community.

Let me copy the contents this time, please make sure to reply inside the forum in the future:

 

>>

you got the right -- trying a post for a get - got that taken care.. now getting bad request 400
<<

 

 


Sonya Mihaljova
Community and Education Specialist

Hey @smynam 

 

so you changed the POST to a GET and now rather than 405 you're getting a 400 bad request?

 

OK - so you're getting through the auth and the content of the request itself is being treated as malformed.

 

This is a GET, right - and you haven't got a payload I'm assuming - so I'd suggest looking at the URI you are submitting.  Compare the URI you are submitting (via the RAW request details) and compare with your requirements.

I expect they'll be some mismatch - there may be a problem with your headers (you can get headers that are too long that cause a 400), but it's more likely that theres a problem with your REST parameters in the URI you are submitting.  Double check what you are submitting (via the RAW) against your requirements - you should see the problem

 

ta

 

rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
smynam
New Contributor

This is how we solved the issue. the request which we are passing through is going through Akamai gateway. 

The Akamai has allowed the request coming from Postman as valid request, while the same request content when requested from Ready API - here Akamai flagged it as an Anomaly library [chat bot] and blocked the request which is making it to fail. 

 

Resolution : The team has proposed adding an user-agent header in the preferences setting under http and that did the trick

 

Please mark it as an solution once validated - happy to learn and contribute back!!

cancel
Showing results for 
Search instead for 
Did you mean: