Problem with impersonation submission

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.