0

I have created two Rest API's in the backend (same webservice), one for the effective URL and other for the Redirected URL. I'm doing a 308 redirection here when user hits effective URL.

Scenario's

  1. When I mark the API's as POST or PATCH or DELETE,

    In Google chrome, my request always goes to the older url (effective) first and then get's redirected to the other one.

    I had breakpoints in both of the API's and validated that the request always hit's effective first for the above 3 HTTP methods. Also, I have hit the API like 20+ times via Ajax from the browser.

  2. When I mark the API's as GET,

    Only the first time, my request goes to the effective url and redirected to the other one. Subsequent call's via the same browser DIRECTLY takes me the other one until I clear the browser cache.

    I suppose this is expected behaviour of permanent redirection (301/308). Also, I'm aware of the difference between 301 and 308.

The major confusion is why the behaviour is not working as intended for NON-GET API's which are POST, PATCH, DELETE etc.

Chrome browser version: Version 88.0.4324.192 (Official Build) (x86_64)

asked Mar 14, 2021 at 6:04
3
  • Browsers simply don't implement this. Commented Mar 14, 2021 at 6:31
  • @Evert can you please be more specific? Commented Mar 14, 2021 at 6:33
  • I'm not sure how else to say it. Browsers don't implement 100% of the HTTP standard. It's going to be hard to track down 'why'. Commented Mar 14, 2021 at 7:15

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.