I have to do this action for use payment service provider's form and add signature on server side. I can modify client and server.
Can I do this?
{"a":"1"}
)—> my_server"signature"
{"a": "1", "signature": 354}
, Location: https://psp.com
)—> client{"a": "1", "signature": 354}
)—> https://psp.comIs the the correct approach? What 3xx is appropriate for this action?
No. You cannot redirect with a body. A redirect doesn't do anything on its own. It simply tells the client that the page has moved or that they should simply see another page instead at this point. That's it. Response done.
A web browser takes the initiative to then actually request that new URL contained in the Location
header of the redirect response. However, it will always issue a GET request for the new URL, and as such, it will not "post" any data along with it.