How to solve php request loss problem

藏色散人
Release: 2023-03-13 13:18:01
Original
2050 people have browsed it

Solution to lost PHP request: 1. Urlencode the encrypted string before sending it; 2. Set the proxy in curl to the 8888 port of fiddler.

How to solve php request loss problem

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

How to solve the problem of php request loss?

php curl post request is lost' 'Problem

Background:

Use a login-free authorization jump with a friend and found that Authorization fails occasionally. After checking the log, it is found that if the password contains the character ' ', the authorization will fail.

Through packet capture, it was found that when php uses curl to send a request, ' ' will be converted into spaces (The reason is unknown...it is suspected that curl does urldecode processing by default)

The solution is:

First urlencode the encrypted string before sending it.

P.S.

In addition, it seems that the packet capture and decoding of https requests on Linux are not easy to handle. Later, I used fiddler to capture packets on Windows. After setting up to capture https, I found that it was out of the php code. The request still failed to be captured. You need to set the proxy in curl to the 8888 port of fiddler to successfully capture

curl_setopt($ch,CURLOPT_PROXY,'127.0.0.1:8888');
Copy after login

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to solve php request loss problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template