开发者

Problem authenticating by doing a POST to an HTTPS page

This relates to my other question on accessing a REST service that uses forms authentication, but I feel it is substantially enough a discrete issue.

When I paste a REST call into my browser address bar, before I am authenticated, I am redirected to a login page on the services web site. I log in and receive a cookie, which authenticates subsequent REST calls or user oriented page reques开发者_高级运维ts.

When I recreate the login screen locally and perform the same HTTPS POST that the online login screen performs, I get the error 422 - Unprocessable Entity. I have compared my POST request and that from their login screen, and there are precisely two headers that differ, being "Referer" and "Cookie". Even when I set these headers in my request to the same as in their request, I still get the same error.


Any REST call you are typing into your address bar is an HTTP GET (or HTTPS GET) not POST -

maybe this is the problem?

just change

<form method="POST">

to

<form method="GET">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜