“Arquivo de Curl Post JSON” Respostas de código

Curl Post JSON

curl -X POST -H "Content-Type: application/json" \
 -d '{"username":"abc","password":"abc"}' \
 https://api.example.com/v2/login
Poised Pheasant

Arquivo de Curl Post JSON

curl -X POST -H "Content-Type: application/json" -d @../data/cats.json http://localhost:8080/mSfvMwNAfj

Comando de objeto JSON Curl Post

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":100}' http://localhost/api/postJsonReader.do
Victorious Vicuña

Publicar Dados da Array JSON Curl

curl -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"tags":["tag1","tag2"],"question":"Which band?","answers":[{"id":"a0","answer":"Answer1"},{"id":"a1","answer":"answer2"}]}' http://example.com/service`
Xanthous Xenomorph

Curl JSON POST

<?php

$url = "https://reqbin.com/echo/post/json";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$headers = array(
   "Content-Type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$data = '{"login":"my_login","password":"my_password"}';

curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);

?>
Arif W3

Respostas semelhantes a “Arquivo de Curl Post JSON”

Perguntas semelhantes a “Arquivo de Curl Post JSON”

Mais respostas relacionadas para “Arquivo de Curl Post JSON” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código