in Education by
I have the following code : curl -X PUT -u ":" \ -H "Content-Type: application/json" \ --data '{"alias": "myalias"}' \ https://go.xxx.com/api/device_tokens// I tried to convert it to php but it seems not working and i don't know what is the problem. this is what i tried <? $token = $_POST["token"]; $al = $_POST["alias"]; exec('curl -X PUT -u "_rEUqXXXmSVEBXXuMfdtg:vpB2XXXXX_2HZ_XXXX7t-Q" \ -H "Content-Type: application/json" \ --data \'{"alias": "'.$al.'"}\' \ https://go.xxx.com/api/device_tokens/'.$token'/'); ?> JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
$ch = curl_init(); // echo $url; die; curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HTTPHEADER, array("custom: header")); $returned = curl_exec($ch); curl_close ($ch); There are many more options to do what you want in the PHP docs, don't they help.

Related questions

0 votes
    This is a cURL function that can send or retrieve data. It should work with any PHP app that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I'm using this code to merge text with an image and it's working fine. But when I use this code with Facebook app, it ... up output. Here is the code I'm using for Facebook app:...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I am working on a C++ program, which uses cURL library, which is written in plain C. When I try ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
0 votes
    URL is http://*.*.*.*/100/?id=1&version=1 params is {"cityId": "110000", "query": {" ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 27, 2022 in Education by JackTerrance
0 votes
    I want to execute a curl command in Python. Usually, I just need to enter the command in the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I'm trying to code a redirect checker, to check if a URL is search engine friendly. It has to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I want to execute a curl command in python. curl -d @request.json --header "Content-Type: application/json" https: ... Help me fix it. Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    The divergence of curl of a vector is zero. State True or False. (a) True (b) False ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The curl of gradient of a vector is non-zero. State True or False. (a) True (b) ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    Curl of gradient of a vector is (a) Unity (b) Zero (c) Null vector (d) Depends on ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The curl of curl of a vector is given by, (a) Div(Grad V) - (Del)^2V ( ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    Which of the following theorem use the curl operation? (a) Green's theorem (b) Gauss ... proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The curl of a curl of a vector gives a (a) Scalar (b) Vector (c) Zero value ( ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    Find the curl of A = (y cos ax)i + (y + e^x)k (a) 2i - ex j - ... theory,electromagnetic theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
...