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 ?


