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 :: js unique array 
Javascript :: how to find the last object in an array 
Javascript :: jquery serialize form data to object 
Javascript :: link in angular 
Javascript :: javascript key pressed enter 
Javascript :: jquery image change on hover 
Javascript :: Iterate with JavaScript For Loops 
Javascript :: string replace javascript 
Javascript :: remove a specific element from an array 
Javascript :: react flip move 
Javascript :: session check in javascript 
Javascript :: import json data in js file 
Javascript :: how to get the first letter of a string in jquery 
Javascript :: get id of first td jquery 
Javascript :: join text in js 
Javascript :: free robux javascript 
Javascript :: javascript create array from 1 to n 
Javascript :: react make component full screen 
Javascript :: react materilize 
Javascript :: usestate array delete 
Javascript :: format time in moment 
Javascript :: how to get all form values in javascript 
Javascript :: remove specific property from json object javascript 
Javascript :: classlist js 
Javascript :: electron get exe path 
Javascript :: how to make nextjs image component responsive 
Javascript :: string to ascii code js 
Javascript :: eas build apk 
Javascript :: check device in flutter 
Javascript :: javascript foreach index 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =