PHP uses the Curl function post request to ASP page to prompt for invalid requests

Source: Internet
Author: User
Tags how to use curl rfc
Title, the following information is returned as a commit:
Error
The URL (URL) you requested is not available

--------------------------------------------------------------------------------

When you try to make the following request:

Post/card/pay_card.aspx http/1.0
Host:pay.m3guo.com
x-real-ip:120.31.66.99
x-forwarded-for:120.31.66.99
Connection:close
user-agent:mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; trident/4.0;. NET CLR 2.0.50727;. NET CLR 3.0.04506.648;. NET CLR 3.5.21022;. NET CLR 3.0.4506.2152;. NET CLR 3.5.30729; infopath.2;. net4.0c;. net4.0e; venus_ie_addon-0.2.8.28; SE 2.X METASR 1.0)
Accept: */*
Referer:http://pay.m3guo.com/card/pay_card.aspx
Cookie:asp.net_sessionid=j3if2045wkqnvnm010lbpe55
content-length:1197
content-type:application/x-www-form-urlencoded
Expect:100-continue


The following error has occurred:

Invalid Request
Invalid request
Some aspect of the HTTP Request is invalid. Possible problems:
Some aspects of the HTTP request are not valid. May be the following issues:

Missing or Unknown request method
Missing request mode or unknown request mode
Missing URL
Missing URLs
Missing HTTP Identifier (http/1.0)
Missing HTTP identifier (http/1.0)
Request is too large
Request command too long
Content-length missing for POST or PUT requests
POST or PUT request missing content length
illegal character in hostname; Underscores is not allowed
The host name contains illegal characters, and underscores are not allowed.

This cache server administrator: webmaster@fastcdn.com.





Master please enlighten, Note: PHP page is to write their own page, by post to the ' People's pages ', ask is not ' people ' do the restrictions ...


Reply to discussion (solution)

Now someone else's web page to do a normal post and then grab the bag with the current proofreading you know where the need to modify.

Well, I'm using HTTPANALYZERSTD to capture the data obtained by the software, I am based on this data to synthesize the post request data submitted, do not know where the error! Dizzy dead now other People's web page to do a normal post and then grab the bag with the current proofreading you know where the need to modify.

Well, I'm using HTTPANALYZERSTD to capture the data obtained by the software, I am based on this data to synthesize the post request data submitted, do not know where the error! It's dead. Reference 2 Floor Phpnewnew's reply:
Now someone else's web page to do a normal post and then grab the bag with the current proofreading you know where the need to modify.

So, did you check all the parameters? Is the Post's header post completely consistent with the content?

Reference 3 Floor Xiaoyao_studio's reply:

Well, I'm using HTTPANALYZERSTD to capture the data obtained by the software, I am based on this data to synthesize the post request data submitted, do not know where the error! It's dead. Reference 2 Floor Phpnewnew's reply:
Now someone else's web page to do a normal post and then grab the bag with the current proofreading you know where the need to modify.


So, did you check all the parameters? Post's head post ...
In addition to the Curl method in PHP can be set: URL, post parameters and values, cookies, user-agent, Referer, the other herder content how to use curl settings?

Reference 4 Floor Phpnewnew's reply:
Reference 3 Floor Xiaoyao_studio's reply:

Well, I'm using HTTPANALYZERSTD to capture the data obtained by the software, I am based on this data to synthesize the post request data submitted, do not know where the error! It's dead. Reference 2 Floor Phpnewnew's reply:
Now someone else's web page to do a normal post and then grab the bag with the current proofreading you know where the need to modify.


So you are ...

The general judgment is these things. Is your curl cookie set up correctly? and the post content.

Reference 5 Floor Xiaoyao_studio's reply:

Reference 4 Floor Phpnewnew's reply:
Reference 3 Floor Xiaoyao_studio's reply:

Well, I'm using HTTPANALYZERSTD to capture the data obtained by the software, I am based on this data to synthesize the post request data submitted, do not know where the error! It's dead. Reference 2 Floor Phpnewnew's reply:
Now someone else's web page to do a normal post and then grab the bag with the current ...

Yes, but I've checked the match, and it's absolutely consistent, what if the protocol for setting up HTTP with Curl is set?
To set into http/1.1

I've done some simulations before. Of course, when developing desktop programs, it is not a problem to find http/1.1 and http/1.0.

Are there any fundamental differences between the two protocols in the call? HTTP protocol update to 1.1 What's changed?

I've done some simulations before. Of course, when developing desktop programs, it is not a problem to find http/1.1 and http/1.0.

Are there any fundamental differences between the two protocols in the call? HTTP protocol update to 1.1 What's changed?

Reference 8 Floor Phpnewnew's reply:
I've done some simulations before. Of course, when developing desktop programs, it is not a problem to find http/1.1 and http/1.0.


Are there any fundamental differences between the two protocols in the call? HTTP protocol update to 1.1 What's changed?

You can only go to the official RFC document.

Reference 10 Floor Xiaoyao_studio's reply:

Reference 8 Floor Phpnewnew's reply:
I've done some simulations before. Of course, when developing desktop programs, it is not a problem to find http/1.1 and http/1.0.


Are there any fundamental differences between the two protocols in the call? HTTP protocol update to 1.1 What's changed?


You can only go to the official RFC document.

Good. I'll see for myself.

Does the landlord have the result?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.