Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

curl post json

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

curl post json object command

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

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);

?>
Comment

send json by curl

root@mcsOS:~# curl -X PATCH -d '{"user-block-request":"true"}' 127.0.0.1:8082/v1/ticket-validators -i
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to make a bigint in javascript 
Javascript :: fetch in vue 3 
Javascript :: javascript in python 
Javascript :: some in js 
Javascript :: destructuring js 
Javascript :: spread operator in js 
Javascript :: ternary javascript 
Javascript :: for pug 
Javascript :: javaScript disable submit button until form is fully validated 
Javascript :: copy to clipboard jquery 
Javascript :: for loop vue object 
Javascript :: crypto random string javascript 
Javascript :: unexpected end of json input 
Javascript :: javascript variable scope 
Javascript :: javascript validator 
Javascript :: javasript object 
Javascript :: javascript comparison 
Javascript :: how to make pdf of web page 
Javascript :: react admin data provider 
Javascript :: angularjs popup 
Javascript :: how to pass functions as a props in react js 
Javascript :: nodejs controller 
Javascript :: how to add alert on javascript 
Javascript :: add 2 class names react 
Javascript :: setimmediate javascript 
Javascript :: download in react 
Javascript :: fetch timeout 
Javascript :: javascript sandbox 
Javascript :: how to call function with only selected arguments in javascript 
Javascript :: npm request cancel 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =