Answers for "curl request post"

PHP
18

curl post json

curl -X POST -H "Content-Type: application/json" \
 -d '{"username":"abc","password":"abc"}' \
 https://api.example.com/v2/login
Posted by: Guest on July-03-2020
10

http post request php curl

$post = [
   'teste' => $_POST['teste']
];
httpPost('url.com', $post);
// function
function httpPost($url, $data)
{
   	$curl = curl_init($url);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($curl);
    curl_close($curl);
    return $response;
}
Posted by: Guest on June-08-2020
2

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
Posted by: Guest on August-12-2021
2

curl post

curl --data "param1=value1&param2=value2" https://example.com/post
Posted by: Guest on September-22-2020
1

curl https post

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

curl -H "Content-Type: application/json" --data "@C:\Users\xxx\Desktop\body.json" https://example.com/api/service
Posted by: Guest on December-23-2020

Browse Popular Code Answers by Language