1

私はあまりカールに精通していませんが、誰かが私が以下をphpに変えるのを手伝ってくれるかどうか疑問に思っていました:

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"tester":{"email":"justin@prefinery.com","status":"applied","profile":{"first_name": "Justin", "last_name": "Britten"},"responses":{"response":[{"question_id":"23874", "answer":"a text response"},{"question_id":"23871", "answer":"1"},{"question_id":"23872", "answer":"0,2"},{"question_id":"23873", "answer":"9"}]}}}' https://account.prefinery.com/api/v2/betas/1/testers.json?api_key=secret

あなたが良いカールチュートリアルを知っているなら、それも大きな助けになるでしょう。

4

1 に答える 1

0

このようなもの

 $ch = curl_init();
            $json = '{"tester":{"email":"justin@prefinery.com","status":"applied","profile":{"first_name": "Justin", "last_name": "Britten"},"responses":{"response":[{"question_id":"23874", "answer":"a text response"},{"question_id":"23871", "answer":"1"},{"question_id":"23872", "answer":"0,2"},{"question_id":"23873", "answer":"9"}]}}}';
            $url = 'https://account.prefinery.com/api/v2/betas/1/testers.json?api_key=secret';
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Accept: application/json'));
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            $result = curl_exec($ch);
于 2013-02-18T17:01:20.753 に答える