Create a URL with credentials

别来无恙 提交于 2019-12-11 16:58:36

问题


I would like to provide links to a website with the credentials already within the link. The link is:

https://mychart.covh.org/MyChart/

The credentials are:

Username = AllStarUser
Password = FiveStarPassword

I have tried

https://mychart.covh.org/MyChart/?Username=AllstarUser,Password=FiveStarPassword

and

http://mychart.covh.org/Mychart/logincheck.asp?login=AllStarUser&password=FiveStarPassword

but these don’t work. Any suggestions?


回答1:


This is a POST form (method="post"). The form data has to be enclosed in the body of the HTTP request.

If it were a GET form (method="get"), you could enclose the form data in the URL, which is specified in the header of the HTTP request.

See also:

  • HTML 4.1: Form submission
  • HTML 5.2: Form submission
  • Stack Overflow: How are parameters sent in an HTTP POST request?



回答2:


If this was a "get" -

https://mychart.covh.org/MyChart/logincheck.asp?Login=AllStarUser&Password=FiveStarPassword  

would be correct.



来源:https://stackoverflow.com/questions/54201943/create-a-url-with-credentials

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!