我打电话给Api发送短信。
以下是我需要拨打的链接
http://login.onlinebusinessbazaar.in/vendorsms/pushsms.aspx?user=xxx&password=xxx1&msisdn=99245xxxxx&sid=xxxx&msg=આપનો સુપુત્ર/સુપુત્રી તા-28-07-2015ના રોજ શાળામાં ગેરહાજર છે&fl=0&dc=8&gwid=2
但是当我通过curl_exec($url)
或header("location:".$url)
它会自动转换为
http://login.onlinebusinessbazaar.in/vendorsms/pushsms.aspx?user=xxxx&password=xxx&msisdn=99245xxxxx&sid=xxxx&msg=%26%232694%3B%26%232730%3B%26%232728%3B%26%232763%3B%20%26%232744%3B%26%232753%3B%26%232730%3B%26%232753%3B%26%232724%3B%26%232765%3B%26%232736%3B/%26%232744%3B%26%232753%3B%26%232730%3B%26%232753%3B%26%232724%3B%26%232765%3B%26%232736%3B%26%232752%3B%20%26%232724%3B%26%232750%3B-28-07-2015%26%232728%3B%26%232750%3B%20%26%232736%3B%26%232763%3B%26%232716%3B%20%26%232742%3B%26%232750%3B%26%232739%3B%26%232750%3B%26%232734%3B%26%232750%3B%26%232690%3B%20%26%232711%3B%26%232759%3B%26%232736%3B%26%232745%3B%26%232750%3B%26%232716%3B%26%232736%3B%20%26%232715%3B%26%232759%3B&fl=0&dc=8&gwid=2
我得到了respose从客户端检测到一个潜在危险的Request.QueryString值(msg ="આપ&#2728 ...")。
如果我要复制网址
(http://login.onlinebusinessbazaar.in/vendorsms/pushsms.aspx?user=xxx&password=xxx1&msisdn=99245xxxxx&sid=xxxx&msg=આપનો સુપુત્ર/સુપુત્રી તા-28-07-2015ના રોજ શાળામાં ગેરહાજર છે&fl=0&dc=8&gwid=2)
浏览器它工作正常。先感谢您 。
答案 0 :(得分:1)
Use urlencode($url)
to encode the URL before calling curl_exec()
.