Código :
<?php $data =array( 'coordinates' => array(19.365243, -99.168738), 'magnitude' => (float) 8.0, 'description' => "Prueba simple", 'country_code' => "MX", 'provider' => "sss" ); /*$data={"coordinates": [19.365243, -99.168738], "magnitude": 4.42, "description": "Evento ingesta test Azure", "ss_ss": "MX", "provider": "ddssd" }*/ $json = json_encode($data); echo $json; $ch = curl_init("http://adonde me conecto/"); curl_setopt_array($ch, array( CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $json, CURLOPT_HTTPHEADER => array( 'X-ZUMO-APPLICATION' => 'clave 1', 'X-ZUMO-MASTER' => 'clave2', 'Content-type' => 'application/json', 'Content-length' => strlen($json)), CURLOPT_RETURNTRANSFER => true )); $response = curl_exec($ch); echo $response; ?>
Pero me marca
HTTP Error 405.0 - Method Not Allowed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.
Most likely causes:
The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.
A request was sent to the server that contained an invalid HTTP verb.
The request is for static content and contains an HTTP verb other than GET or HEAD.
A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.
Things you can try:
Verify the list of verbs enabled for the module handler this request was sent to, and ensure that this verb should be allowed for the Web site.
Check the IIS log file to see which verb is not allowed for the request.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
y jamas puedo guardar en la base donde disque me conecto, alguien tiene alguna sujerencia??