[Php] request to use curl hair post supposed to appear 400?

Recently been using curl, use a curl with a deeper understanding, but encountered a problem today, let Guaren really a headache ah.

Old boy needs a long talk - is the session cross-domain, cross-server shared

I was thinking since it is shared, that there must be an intersection -

1, session storage (database), both servers to the database to read data on ok

2, no storage or session to write in a file, open a server to another server in a session of the interface does not get on the end

 

session storage Needless to say, absolutely feasible, but the company's current small scale, principles of faith could save the province, we chose the second option, the implementation of this program has given Guaren;

first, I set up a lnmp environment to simulate a server, and the local environment as a wamp another server, see if you can local virtual machine to obtain the information session

the first step: get request to

       use curl to send a get request to obtain session information, wood has a little bit of a problem, but considering the get request, insecurity, if the information is supposed to hijack? So give up

the second step: post

      when using the post, there is a big nod, has prompted 400 Bad Request error, your uncle, get good, a quick change post would not it?
After searching, thinking, finally found the reason - the original curl when sending post request, there is a strict limit: post must be uppercase

Guess you like

Origin www.cnblogs.com/thesumer/p/11635373.html