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 :: validate latitude longitude javascript 
Javascript :: node fs exists 
Javascript :: js insert emoji 
Javascript :: jquery remove duplicates from array 
Javascript :: ajax failure response 
Javascript :: javascript change hidden input value 
Javascript :: javascript get first 3 characters of string 
Javascript :: fs , valid path check 
Javascript :: javascript get current date 
Javascript :: uncaught TypeError: $.jajax is not a function 
Javascript :: js check if string is number 
Javascript :: button in vanilla js 
Javascript :: reload page with parameters javascript 
Javascript :: read a file nodejs 
Javascript :: nextjs change port 
Javascript :: get select2 selected value jquery 
Javascript :: how to find lcm in javascript 
Javascript :: exit from fullscreen 
Javascript :: nextsibling vs nextelementsibling 
Javascript :: fullcalendar v5 time format am/pm 
Javascript :: find the largest number in array javascript 
Javascript :: regex urls 
Javascript :: get form data in react 
Javascript :: npm install global vs local 
Javascript :: js onclick change styles 
Javascript :: javascript capitalize array 
Javascript :: js navigate to anchor 
Javascript :: Getting Binary gap in JS 
Javascript :: javascript array flat 
Javascript :: package.json set environment variables 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =