HttpSocket and PHP

Hi guys,
i need to update a desktop app i’ve made integrating some online contents i receive from a web server.
Until now all the contents were stored in a local mysql db but in few weeks customer and invoices data will be on a web server. I have some API documents from the web server provider and i should integrate these new procedures in my app.

Here is an example :

<?php $url = "https://websiteaddress/request/info"; $request = array("api_uid" => "xxxxxx", "api_key" => "xxxxxxxxxxxxx"); $options = array( "http" => array( "header" => "Content-type: text/json\\r\ ", "method" => "POST", "content" => json_encode($request) ), ); $context = stream_context_create($options); $result = json_decode(file_get_contents($url, false, $context), true); print_r($result); ?>

Could someone tell me if it’s possibile to send to the webserver this request and how to retreive the content from $result ?

Thanks
Mattia

Seems like that would work. You would use the HTTPSocket and Xojo’s JSONItem class or Xojo.Net.HTTPSocket and Xojo.Data.ParseJSON, GenerateJSON methods.

This page has links to a variety of blog posts and videos about using web services: Web Services