Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "\nHello World.\n";
- $signUp;
- $signUp["Host"] = " ishin-global.aktsk.com"; //generic host url;
- $signup["Accept"]=" */*";
- $signUp["Content-Type"]=" application/json";
- $signUp["X-Platform"]=" android";
- $signUp["X-ClientVersion"]=" 3.3.1"; //Can be pseudo static in nature
- $signUp["Content-Length"]=" 252";
- //echo $info;
- echo $signUp["X-ClientVersion"];
- //echo "connect to "."http://ishin-global.aktsk.com/auth/sign_up";
- $payLoad='{"user_account":{"ad_id":"9e2170cd-bded-4103-9274-fbfefc7cf14a","country":"US","currency":"USD","device":"Google","device_model":"Pixel XL","os_version":"7.1.2","platform":"android","unique_id":"ecaf41c8-c478-4865-b0f8-af0e7bfa4484:b2f53b1d34d823f1"}}';
- $payLoad = json_decode($payLoad,true);
- if(json_last_error()=== 0)
- {
- echo "Payload is valid JSON";
- }
- else
- {
- echo "Payload is not valid JSON";
- }
- connect("http://ishin-global.aktsk.com/auth/sign_up", $signUp,$payLoad);
- function connect($url,$dataArray,$payLoad)
- {
- $channel = curl_init(); //establishing cURL connection;
- curl_setopt($channel,CURLOPT_URL,$url);
- curl_setopt($channel,CURLOPT_POST,1);
- curl_setopt( $channel, CURLOPT_HTTPHEADER,$dataArray);
- curl_setopt($channel, CURLOPT_POSTFIELDS, json_encode($payLoad));//Fields of the POST
- //curl_setopt($channel,CURLOPT_RETURNTRANSFER,true);
- $respone = curl_exec($channel);
- if(isset($response))
- {
- echo "\nResponse ".$response."\n";
- }
- curl_close($channel);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement