post jason data with curl:
curl -H "Content-Type: application/json" -X POST -d '[{"x":115.80796583333334,"y":36.23307472222222,"z":null}]' http://mars.amap.com/wgs2gcj
linux 下使用 curl 訪問帶多參數,GET掉參數解決方案
url 為 http://mywebsite.com/index.php?a=1&b=2&c=3
curl? -s? http://mywebsite.com/index.php?a=1&b=2&c=3
然而在linux下,上面的例子 $_GET只能獲取到參數 a
由于url中有&其他參數獲取不到,在linux系統中 &會使進程系統后臺運行
必須對 &進行下轉義才能 $_GET獲取到所有參數
curl? -s? http://mywebsite.com/index.php?a=1\&b=2\&c=3
當然,最簡單的方法 用雙引號把整個url引起來就ok了
curl? -s? "http://mywebsite.com/index.php?a=1&b=2&c=3"