php curl post

Solutions on MaxInterview for php curl post by the best coders in the world

showing results for - "php curl post"
Francesco
04 Oct 2019
1$post = [
2   'teste' => $_POST['teste']
3];
4httpPost('url.com', $post);
5// function
6function httpPost($url, $data)
7{
8   	$curl = curl_init($url);
9    curl_setopt($curl, CURLOPT_POST, true);
10    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
11    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
12    $response = curl_exec($curl);
13    curl_close($curl);
14    return $response;
15}
Naomie
15 Sep 2017
1// set post fields
2$post = [
3    'username' => 'user1',
4    'password' => 'passuser1',
5    'gender'   => 1,
6];
7
8$ch = curl_init('http://www.example.com');
9curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
10curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
11
12// execute!
13$response = curl_exec($ch);
14
15// close the connection, release resources used
16curl_close($ch);
17
18// do anything you want with your response
19var_dump($response);
Leni
23 Oct 2019
1<?php
2
3$post = [
4    'username' => 'user1',
5    'password' => 'passuser1',
6    'gender'   => 1,
7];
8$ch = curl_init();
9curl_setopt($ch, CURLOPT_URL, 'http://www.domain.com');
10curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
11curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
12$response = curl_exec($ch);
13var_export($response);
14
Axel
28 Jan 2019
1// Get cURL resource
2$curl = curl_init();
3// Set some options - we are passing in a useragent too here
4curl_setopt_array($curl, [
5    CURLOPT_RETURNTRANSFER => 1,
6    CURLOPT_URL => 'http://testcURL.com',
7    CURLOPT_USERAGENT => 'Codular Sample cURL Request',
8    CURLOPT_POST => 1,
9    CURLOPT_POSTFIELDS => [
10        item1 => 'value',
11        item2 => 'value2'
12    ]
13]);
14// Send the request & save response to $resp
15$resp = curl_exec($curl);
16// Close request to clear up some resources
17curl_close($curl);
18
Marin
13 Jun 2016
1    $post_data_arr = [
2      'f_name' => 'First',
3      'l_name' => 'Last',
4    ]; 
5    
6    $url = 'http://example.com';
7    $curl = curl_init($url);
8    curl_setopt($curl, CURLOPT_POST, true);
9    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data_arr);
10    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
11    $response = curl_exec($curl);
12    curl_close($curl);
13    print_r($response);
14 
Salvatore
26 Mar 2016
1$headers = array(
2            'Content-Type: application/json',
3            "x-access-token: $token"
4        );
5        $urlPost = "/child/all";
6        $url = "ip/apiurl"
7        $curl = curl_init($url);
8        curl_setopt($curl, CURLOPT_URL, $url);
9        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
10        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
11        $response = curl_exec($curl);
12        curl_close($curl);
13        $jsonObject = json_decode($response);
14        return $jsonObject;
queries leading to this page
send post request php curlcurl i phpphp curl with post datahow to use php curl to post to an apicurl request get phpcurl post request in phpcurl post api phppost with curl phpphp curl post request with response examplesend postcurl phpmake curl post request phpcurl with phpphp curl method postcurl php method gethttp post request php curlget request curl phpphp curl post parameterscurl post example phppost request using curl phpsend post request phpphp post request curl returncurl from phpcalling post curl api in phpcurl send get request phpcurl post url phpphp get curl responsephp curl requetphp curl example with postphp curl 24curl php post method callcurl send data phpcurl post string phppost request php curlphp curl getphp curl get request with parameterssend form data using php curlsend data curl post phpphp curl appi postphp request by curlphp 2b curl http post sample codeapi call php curluse curl php postcurl get requests in phpget curl in phpphp curl rest api examplecurl php with posthow can we get post data with api in curl in phpcurl in php post examplecurl get request phppost request with curl phpcurl response phpcurl post exampl phpmake post request with curl phppost com curl phpphp curl post payloadapi call using curl in phpphp curl responsehow to post data in curl phpphp curl send post requestcurl php set post datasend request php curlcurl post method in phppost php curlpost data in php curlphp curl get request functioncurl post message phpcurl phpcurl php set postcurl setopt post datapost request in curl phpcurl data phpdo a curl request phpcurl php get responsephp post data curlcurl to phpphp post using curlphp simple curl examplecurl send post data phppost data in curl phpcurl php method postphp curl request send post datacurl php post examplecurl call in phpcurl sent post phppost api in php curlcurl post phpcurl send post request phpsend get request with curl phpphp example curl http requestcurl and request phpcurl post reqest phpphp curl postcurl using phphow to pass curl post data in phpcurl send php postphp curl setopt post datacli curl post in phpcurl api post phppost api using curl phphow to call api in php using curlpost example by curl in phpphp send curl requestphp make curl requestphp curl requestget api data in post php curlphp curl post form dataphp curl getphp post http curlsend get request php curlphp curlopt postcurl php getcurl php postdo a curl post request phpsend curl request php jsoncurl request phpset post with curl phpphp send curl post requestpost php with curlcurl make https request phpcurl post data with phpsimple curl get request phpphp curl putcurl request post phppost code php curlcurl psot phpphp curl post datahow to do a curl request in phpcurl pust request data phpphp 2b curl 2c http post sample code 3fphp simple curl php 7 send curl post with bodysend post request curl phpphp curl infoview curl request phpcurl post body phppost api curl phpcurl send post call phpcurl as post phppost curl data phpsend post to a url curl phpget request with curl phpphp curl get responsephp curl example codecurl post request example phpcurl get phpphp curl request post datacurl php get requesthow to make api requests using curl phpcurl post to url link phphow to send curl get request phpcurl to send post request phpsend post request in curl phppost data using curl phphow to use curl post mehtod in phppost curl in phpcurl post data php examplecurl call phpcurl post using php scriptphp curl post requestphp install curlphp output curl requestphp make post request curlphp curl get requestpost data with curl phpcurl php examplephp curl post request with authentication curl rest request example phphow to send a post request in php using curlcurl request php postcreate curl in phpcurl php send postphp curl post data examplesend the curl data in phpput request in php curlphp curl send received requestcurl request in phpsend post curl in phpphp make curl callsend post request using curl phpcurl post data phpsend php data curl and get data curlcurl post request with data phpcurl php send php 3a 2f 2finputget response body curl phpcurl make post request phpphp curl request posthttp request in php curl curl post in phpphp get request curlhpw to use curl with phpcurl php send post requesthow to echo curl response in phpcurl code in phpcurl to post phpcurl get request php examplecurl request example phpuse curl in phpsend data with post in php curlcurl in php exampleexecute http get request curl in phpcurl post request phpcurl call get api php1 returns form curl phppost curl request in php 5dcurl get url phpcall curl with post method in phpsimple curl request phpphp curl post request phpphp use curl to post apiphp curl with postphp post with curlphp curl stringphp curl set post tyhpesimple curl post phpusing curl in phpsend post data php curlhow to get curl response in phpphp curl callhow to get response from curl phpcurl get php examplecurl send post request in phpcurl php apicurl function in phpsend by curl in phpcurl example phpphp get curl requesthow to execute a curl post on phpcurl post method send data phppost request curl phppost in php curlget request using curl phpcurlopt post phphow to set post method in curl phpphp curl request with body datacurl call in php postmethod post with curl phpcurl add data to post phppost curl example phpset post data in curl phphow to curl with phpphp curl post examplesend curl post php and responsephp curl post with parameterscurl request with post parameters in phpphp curl post jsonsend data using php curlmake a curl request phpget curl phphow to use curl post phpcurl in php postphp post request curlget method using curl in phpcurl post phpmake curl request in phpphp send post request curl functionhow to use curl in phpcurl php example post jsonpost data php curlcurl in phpphp curl get examplecurl get get phpphp curlcurl basic get request phpphp curl examplecurl api post request phpcurl get request with parameters phpphp post curlcurl php post paramscurl php post requestphp curl send postsimple request curl phpcurl send post phpcurl example in phpcurl get response phpphp curl set postcurl d paramsdo a curl call phppost in curl phpcurl request send in phppost curl phpcurl functions in phpcurl to php curlsend post with curl phpphp curl post