Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 12.5 ('Yosemite')
Instant purchase and download via GumRoad!

FEATURE

Inside HandleSpecialURL

How to use Web Edition for your own REST API

Issue: 12.5 (September/October 2014)
Author: Christian Schmitz
Author Bio: Christian Schmitz is the creator of the Monkeybread Software Xojo/Real Studio Plugins.
Article Description: No description available.
Article Length (in bytes): 10,073
Starting Page Number: 35
Article Number: 12506
Resource File(s):

Download Icon 12506project.zip Updated: 2014-09-02 10:53:17

Related Web Link(s):

http://127.0.0.1
http://127.0.0.1
http://www.xojo.com/blog/en/2014/08/handlespecialurl-changes-in-2014r21.php

Excerpt of article text...

With the web edition framework you get a full web server for handling web requests for free. You can use it with the HandleSpecialURL event in the app class. In our example, we use this event to handle requests with a REST-like API. We use JSON to package data for the transfer. This is different from a SOAP web service which uses XML for transfer.

Client

First, the client. We take a new project and name it client. On the main window we place a listbox and a canvas. The listbox will show the list of image file names and the canvas shows the image (see Figure 1).

We add an HTTPSocket to the window and name it sock. Now in the open event of the window you can start a query to the server to get the list of files:

sock.Get "http://127.0.0.1:8080/api/images"

...End of Excerpt. Please purchase the magazine to read the full article.