Ver Mensaje Individual
  #7 (permalink)  
Antiguo 17/01/2013, 20:02
hermes_patrick
 
Fecha de Ingreso: abril-2006
Ubicación: miraflores
Mensajes: 69
Antigüedad: 18 años
Puntos: 1
Respuesta: Php post http request

No se que pasa, no me sale, miren ahora el cambio que hice al código, siento que los headers o el objeto json no estan siendo bien enviados:

Código PHP:
<?php
$str_obj_json
='{
"method":"SUBMIT",
"params":{
        "batchType":"submit",
  "batchId":"alvarons17",
  "origAddr":"550",
  "origTon":2,
  "userData":"Feliz Navidad Movistar",
"submits":
  [
   {"messId":"mess127_001",
   "destAddr":"51971855080"}
  ]
}
}'
;
$headers=array(
'Authorization: Basic dGVzdDp0ZXN0',
'Content-Length: 395',
'Content-Type: application/x-www-form-urlencoded',
'Connection: Keep-Alive',
'Accept: */*');
$url='http://10.10.237.8:21098/SMBULK/BATCH';
$ch curl_init();
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_POSTTRUE);
curl_setopt($chCURLOPT_POSTFIELDS$str_obj_json);
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
curl_setopt($chCURLOPT_HTTPHEADER$headers);
$result curl_exec($ch);
curl_close($ch);
echo 
$result;
?>
__________________
Patrick:policia: