Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP AND JSON HTTP REQUEST

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP AND JSON HTTP REQUEST

Postby pepone » Mon Jan 14, 2013 3:23 pm

Hi all
I'm new in php and json, I have to send a json object to an external platform and i have never used http requests, this is the input the guys from the external platform (http server) has given to me:

This is my php code created as you can see i made the json object manually (check the comment below)
Code: Select all
<?php
$str_obj_json ='{
"method":"SUBMIT","params":{
"batchType":"submit",
"batchId":"alvarons",
"origAddr":"550",
"origTon":2,
"userData":"Movistar les desea Feliz Navidad",
"submits":
  [
   {
   "messId":"mess127_001",
   "destAddr":"51975375377"}
  ]
}
}';
// here is need to send this object to the external platform

?>


Now this is the input they gave me, i think this is the request, header and so

Code: Select all
POST /SMBULK/BATCH HTTP/1.0
Authorization: Basic dGVzdDp0ZXN0
Host: 10.10.10.9:55555
Content-Length: 395
User-Agent: Wget/1.12 (solaris2.10)
Content-Type: application/x-www-form-urlencoded
Connection: Keep-Alive
Accept: */*


How should i make this php file to send the json object according to the parameters above ? :help:
pepone
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Jan 14, 2013 3:15 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron