0

I have decided to transfer web API application to a subdomain, and I need to make stable all old android and ios Applications who use those APIs how can I redirect with param in post method like this :

http://example.com/values/sendData

to :

http://api.example.com/values/sendata

or what is the best solution to solve this problem

1 Answer 1

2

This is a breaking change. You can have the first URL issue a 301 Moved Permanently redirect, but there is no way to recover the post. The client must notice this response status code, check the Location header for the new URL, and then retry the request there. This is all a manual process, and importantly, not something the client is likely to expect or account for, in the first place.

Typically, this is where API versioning would come in. You'd need to keep the old URLs active, and send out a deprecation notice to your clients, along with a date to upgrade by, which should be far enough out to allow your clients to reasonably update the their applications accordingly. Then, you can eventually turn off the old URLs once this date has passed. Clients that have not yet upgraded will still be broken, but you at least gave them fair warning first.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you for your answer, Regarding your conversations, I concluded that users should have to update their Applications

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.