Create a URL with credentials

2019-08-26 08: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.