|
Rank: Member Groups: Member
Joined: 12/19/2020 Posts: 14
|
Hello, why sending the raw request is not working? Quote: var request = new Request("https://demo.wpjobboard.net/wp-login.php") { Method = "POST" };
request.Headers.Add("Content-Length", "19"); request.Headers.Add("Cookie", "wpjb_transient_id=1607759726-1847; wordpress_test_cookie=WP+Cookie+check"); request.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
request.PostData.AddValue("log", "7887"); request.PostData.AddValue("pwd", "789789");
tr.Send(() => { wv.LoadRequestAndWait(request); }, 60000);
|
|
Rank: Member Groups: Member
Joined: 12/19/2020 Posts: 14
|
The Raw Request is: Quote:POST /wp-login.php HTTP/1.1 Host: demo.wpjobboard.net Content-Length: 19 Cookie: wpjb_transient_id=1607759726-1847; wordpress_test_cookie=WP+Cookie+check Content-Type: application/x-www-form-urlencoded
log=7887&pwd=789789
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Your code looks fine. There is no way we can tell you why your server does not like this request though ---- that part you will have to find out from the server. The sever can reject a request for any reason it sees fit --- it could reject it because it doesn't have a cookie that it is looking for, it could reject it because the user name and password you provided is wrong. Or it could even rejected it just because it comes from the "wrong" IP address or at the "wrong" time. So you will have to find out exactly which part your server doesn't like and then correct that.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 12/19/2020 Posts: 14
|
Hi, by testing the raw request here: https://reqbin.com/or testing it inside firefox, it seems there is no problem at all and it is working fine. but it won't work in chrome.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Like we mentioned in our previous reply --- we can't tell you why your server doesn't like the request. You will have to find it out from the server side. Whether to serve a request is COMPLETELY up to your server. For example, whoever setup your server could really hate Chrome and set it up to refuse to serve all other browser but Chrome. Obviously this is an extreme example but just to show you how this kind of things are completely up to the server. As such to resolve such issue, you need to start from the server. You would be wasting your time and our time by chasing this from the client end.
|
|
Rank: Member Groups: Member
Joined: 12/19/2020 Posts: 14
|
please try this one: Quote:POST /account/login?ReturnUrl=%2fforum%2fdefault.aspx HTTP/1.1 Host: www.essentialobjects.comAccept-Encoding: gzip, deflate, br Content-Type: application/x-www-form-urlencoded Content-Length: 211 Email=john%40test.com&HasAccount=True&Password=test&RememberMe=false&submit.x=30&submit.y=7 By sending this raw request, the "Login Failed." message should be displayed, and it is on your server. again it can not be achieved using Chromium.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
John wrote:By sending this raw request, the "Login Failed." message should be displayed, and it is on your server. Isn't this how it should be?
|
|
Rank: Member Groups: Member
Joined: 12/19/2020 Posts: 14
|
No, it is not. When I check the response using GetHTML(), the message (Login Failed) is not there and it only loads the URL without sending the post request.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Our test code must be different than yours then. Please create a small app with your test code and send the test code to us. Once we have that we will run it here and see what we can find. See here for more details on how to send the test project to us: https://www.essentialobjects.com/forum/test_project.aspx
|
|
Rank: Member Groups: Member
Joined: 12/19/2020 Posts: 14
|
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Please change the request Url to https from http. When our server receives an http request, it will automatically redirects to https version. This is the sequence of event:
1. You POST to http://www.essentialobjects.com/account/login with your login information; 2. Our server redirect you to https://www.essentialobjects.com/account/login with 301 permanent redirect response; 3. The WebView follow through this redirect by issuing GET https://www.essentialobjects.com/account/login without your login information
In another word, your post information is lost on step 2 due to the automatic http -> https redirect. If you issue your post directly to https, you will see the desired result.
As you can see, this redirection logic is implemented by our server and we are able to tell you why you did not get the desired result by looking into our server code. This is exactly what we have been trying to tell you in our previous reply --- you need to look into your server to find the root cause why your request does not work for you.
Thanks!
|
|