
Geuthur
Hell Rider'z Funatix
0
|
Posted - 2017.02.15 19:29:22 -
[1] - Quote
Hello,
I have some Problem i scriptet a php script but it doesnt work ....
$cost = 0; $body = 'Test'; $rid = '94547377'; $rtype = 'characters'; $sub = 'test object'; $auth_code = 'my authcode';
function curl_post_group() { $ch = curl_init(); $url = 'https://esi.tech.ccp.is/latest/characters/94547377/mail/?datasource=tranquility'; curl_setopt($ch, CURLOPT_URL, $url); // Set so curl_exec returns the result instead of outputting it. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Does not verify peer curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Get the response and close the channel. $headers = array( "Authorization: Bearer " . $auth_code, "Content-type: json" ); // headers curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // Post options, for get comment out curl_setopt($ch, CURLOPT_POST, 1); $post ["approved_cost"] = $cost; $post ["body"] = $body; $post ["recipients"] = array(); $post ["recipients"] ["recipient_id"] = $rid; $post ["recipients"] ["recipient_type"] = $rtype; //$post ["recipient_id"] = $rid; //$post ["recipient_type"] = $rtype; $post ["subject"] = $sub; $post = json_encode($post, JSON_UNESCAPED_UNICODE); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); $response = curl_exec($ch); $response = curl_exec($ch); if (curl_getinfo($ch) ["http_code"] != 201) { echo "Error"; echo " HTTP_CODE:" . curl_getinfo($ch) ["http_code"]; print_r(curl_getinfo($ch)); print_r($response); } curl_close($ch); $response = json_decode($response); return $response; } curl_post_group();
can anybody help me ... or what make i false ..
sry my english isnt good ^^ (German Language) |

Geuthur
Hell Rider'z Funatix
0
|
Posted - 2017.02.16 14:41:22 -
[2] - Quote
The Curl Command thats work at the site https://esi.tech.ccp.is/latest/#!/Mail/post_characters_character_id_mail
curl -i --compressed -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer 'auth code from geuthur' -d '{ \ "approved_cost": 0, \ "body": "string", \ "recipients": [ \ { \ "recipient_id": 0, \ "recipient_type": "alliance" \ } \ ], \ "subject": "string" \ }' 'https://esi.tech.ccp.is/latest/characters/94547377/mail/?datasource=tranquility'
But i doesnt know why my script doesnt works...
it give a Error HTTP_CODE:500Array
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. |