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 request

curl -d "user=user1&pass=abcd" -X POST https://example.com/login
Comment

curl post

# dont forget the content type, else it will throw an error

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

curl post

curl -X POST -d "param1=value1&param2=value2" https://example.com/post
Comment

curl post

curl --data '' https://example.com/resource.cgi

curl -X POST https://example.com/resource.cgi

curl --request POST https://example.com/resource.cgi
Comment

curl post

curl -d "@data.txt" -X POST http://localhost:3000/data
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

curl post

curl -H "Content-Type: application/json" -d "@data.json" -X POST http://localhost:3000/data
Comment

curl post request

curl -d "user=user1&pass=abcd" https://example.com/login
Comment

curl https post

curl -d "" https://example.com

curl -H "Content-Type: application/json" --data "@C:UsersxxxDesktopody.json" https://example.com/api/service
Comment

curl POST

curl-X POST http://localhost:8080/api/guests -H 'Content-Type: application/json' -d '{"lastName":"Zithi", "firstName":"Ans"}'
-H header content
-d json payload/data
Comment

curl http post request example localhost

{
    "value":"nodejs"
}
Comment

curl get request

curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource
Comment

PREVIOUS NEXT
Code Example
Javascript :: Check if instance is array 
Javascript :: date format in javascript 
Javascript :: react create array 
Javascript :: stop python script nodejs 
Javascript :: $out in mongodb 
Javascript :: $$ promise then 
Javascript :: set date to input date 
Javascript :: captalize first letter javascript 
Javascript :: generate qr code react 
Javascript :: url_for javascipt 
Javascript :: iterating string js 
Javascript :: Setting darkmode using Tailwind 
Javascript :: discord.js buttons 
Javascript :: create a promise in javascript 
Javascript :: convert html to png javascript 
Javascript :: react-native-safe-area-context 
Javascript :: Javascript using for loop to loop through an array 
Javascript :: concat 
Javascript :: how to slice array in angular 6 
Javascript :: try catch javascript 
Javascript :: extends vs includes use case 
Javascript :: URLSearchParams 
Javascript :: React social login button 
Javascript :: hide html elements 
Javascript :: Convert mnemonic to seed in javascript 
Javascript :: ready function jq 
Javascript :: object find javascript 
Javascript :: react link onclick refresh page 
Javascript :: ajaxsetup beforesend 
Javascript :: file upload nest 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =