question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

307 Temporary Redirect while hitting API on Amazon API Gateway using Rest-Assured

See original GitHub issue

Hi,

I am trying to hit an API in AWS using Rest-Assured.

The same API hit (with same header data) works fine from Postman but while hitting the request from Rest-Assured, I always receive following response:

<html> <head> <title>307 Temporary Redirect</title> </head> <body bgcolor="white"> <center> <h1>307 Temporary Redirect</h1> </center> <hr/> <center>CloudFront</center> </body> <\html>

Is there any specific setting that needs to be done to hit an API on Amazon API Gateway.

Thanks in advance!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

1reaction
samuelcbirdcommented, Jul 1, 2022

I was also facing the same issue. The solution for me was to remove the extra “/” at the end of the path.

Previously: https://example.com/v1/api/login/ Now: https://example.com/v1/api/login

Hope that works 🤞

I’ve been scratching my head for days as to why the GET request was working and returning my landing page, but any of my other endpoints weren’t returning anything.

On Postman i was getting “too many redirects” and on API Gateway I was getting Status: 307, no data.

Turns out it was the “/” at the end of the path where I’m declaring the routes. Silly me.

Thank you so much.

1reaction
firat-sivrikayacommented, Jun 3, 2022

I was also facing the same issue. The solution for me was to remove the extra “/” at the end of the path.

Previously: https://example.com/v1/api/login/ Now: https://example.com/v1/api/login

Hope that works 🤞

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws api gateway - HTTPIE 307 Temp Redirect - APIGATEWAY
It works perfectly from Postman, but HTTPie doesn't seem to work for me, and only throws a 307 Temporary Redirect. Using the following...
Read more >
Troubleshoot HTTP 307 errors in Amazon S3
When I send requests to an Amazon Simple Storage Service (Amazon S3) bucket, Amazon S3 returns a 307 Temporary Redirect response.
Read more >
307 Temporary Redirect: What It Is and How to Fix It
A 307 Temporary Redirect message is an HTTP response status code indicating that the requested resource has been temporarily moved to ...
Read more >
rest assured follow redirects
307 (Temporary Redirect) A 307 response indicates that the REST API is not going to process the client's request. Instead, the client should...
Read more >
API Automation Testing With Rest Assured
API Rest Assured Testing. ... For example, you are using an API when paying for your new clothes online with a credit card....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found