Browser Displays the
The parameters are:
Method GET
Model {"SearchString": "B0036sgfb6", "Lang": "Ja_jp", "MarketPlace": "a1vc38t7yxb528"}
The source code is:
method=get&model=%7b%22searchstring%22%3a%22b0036sgfb6%22%2c%22lang%22%3a%22ja_jp%22%2c%22marketplace%22% 3a%22a1vc38t7yxb528%22%7d
May I ask Curl_setopt ($ch, Curlopt_postfields, $data) $data How to write it?
Reply to discussion (solution)
$data is an associative array, and the association key is the name of the form control.
Xuzuning greatly:
That's what I'm doing now.
$data = ' method=get&model= '. UrlEncode (' {' searchstring ': ' B0036sgfb6 ', ' lang ': ' Ja_jp ', ' marketPlace ': ' a1vc38t7yxb528 "}");
curl_setopt ($ch, Curlopt_postfields, $data);
Got the results I wanted to, but now there's a problem:
$data _ar=array (
"SearchString" = "B0036sgfb6",
"Lang" = "JA_JP",
"MarketPlace" = "a1vc38t7yxb528"
);
Excuse me, how can I submit the $data_ar??
I want to commit the array out instead of a dead string
$data _ar=array (
"SearchString" = "B0036sgfb6",
"Lang" = "JA_JP",
"MarketPlace" = "a1vc38t7yxb528"
Excuse me, how can I submit $data_ar??;
To get the results, I use Print_r ($value) content:
{"Data": [{"link": "http://www.amazon.co.jp/gp/product/B0036SGFB6/ref=xx_xx_cont_xx/378-0276217-1847765", " Dimunits ":" センチメ?トル "," thumbnail ":" Https://images-na.ssl-images-amazon.com/images/I/41zK5Evzv2L._SL80_.jpg "," SubCategory ":" 14700954 "," dimensions ": {" width ": 7.3914," Length ": 20.8026," height ": 2.794}," GL ":" Gl_pc "," image ":" Https://images-na.ssl-images-amazon.com/images/I/41zK5Evzv2L._SL120_.jpg "," weightunits ":" キログラム "," ProductGroup " : "147", "Weight": "0.0998", "ASIN": "B0036sgfb6", "whiteglovesrequired": "N", "title": "ELECOM usb2.0ケ?ブルa-bタイプ2mブラック U2C-B20BK [Personal Computers] "}]," errormessage ": null}
Isn't this an array? Why $value[0] or $value["data"] no content output??
What you Print_r ($value) Get is the JSON string
Need to be decoded before using Json_decode