简体   繁体   中英

return http response redirect with destination url, python

Noob Here, I am having issues with my registration form in ajax and javascript. So I am seeing how to do a return httpresponse with a destination URL in a python script. I am not using django or flask. Does anyone know of a page that I can read to understand this topic.

Questions 1. Does this have any import dependencies? 2. Is this code correct down below? and if not what can be done to fix it. I want to send it to a thank you page.

return HttpResponseRedirect("url")

No. The code you have is a Django snippet and will not work unless you are using Django.

If you are not using any framework, then return a 303 See Other status code, along with a Location header with the URL to your thank you page.

The HyperText Transfer Protocol (HTTP) 303 See Other redirect status response code indicates that the redirects don't link to the newly uploaded resources but to another page, like a confirmation page or an upload progress page. This response code is usually sent back as a result of PUT or POST. The method used to display this redirected page is always GET.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM