Using curl pass cookie error problem

Work found a problem, the user interface to deliver operational cookie data calls through curl, program interface can not parse the data in the cookie.

After investigation found that cookie data is sent curl 

TZ + Gn + rek + 6G4d

And an interface accessible to the cookie data

TZ Gn RECs 6G4d

Interface extracted original data is decode, equivalent to urldecode ( 'TZ + Gn + rEk + 6G4d'), the result is such TZ Gn rEk 6G4d

"+" Sign will be urldecode into space, data errors, of course parse error.

Solution:

cookie values ​​passed curl is needed after the urlencode, 

urlencode('TZ+Gn+rEk+6G4d') = TZ%2BGn%2BrEk%2B6G4d

Such interface data fetch data is equivalent urldecode ( 'TZ% 2BGn% 2BrEk% 2B6G4d'), the result is the TZ + Gn + rEk + 6G4d 

 

Reproduced in: https: //www.cnblogs.com/caly/p/3514250.html

Guess you like

Origin blog.csdn.net/weixin_34351321/article/details/93538128