Please excuse me if i coun't explan well, i just need some examples, links or whatever you can provide me to learn how this works.
I'm trying to make this webservice work with PHP, also i have this as an example, that works with JS, but this webservice has some restrictions, like "I cannot consume at least has a different origin lenguage consumer".
This si the example.
$.ajax(
{
type:"POST",
contentType:"application/json;charset=utf-8",
url:"https://somewebsite.com/setsomedata",
data:"{}",
dataType:"json",
async: false,
success: function(msg) {
a("#compInter",msg.d.data1);
a("#ventInter",msg.d.data2);
a("#compAgencia",msg.d.data3);
a("#ventAgencia",msg.d.data4);
},
error: function(textStatus, errorThrown, errorDetail){
alert(errorDetail);
}
});
So, the problem is that i cannot use Jquery/Javascript to consume this data, because i need to use PHP to make this work.
So, i think i'm really lost in this case, that's why i would like to get some help, anything you can provide to make this work.
i'm trying to do this with PHP but i'm still gettint this error : [failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error ]
and this is my PHP code:
<?php
$result = json_decode(file_get_contents('https://somewebsite.com/setsomedata'),true);
print_r($result);
?>
Again, thank you so much.