Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

Article Preview


Buy Now

PDF:

Web Applications

Easy Web Services

Creating a Web API

Issue: 10.1 (November/December 2011)
Article Description: No description available.
Article Length (in bytes): 5,099
Starting Page Number: 81
RBD Number: 10012
Resource File(s):

Download Icon 10012.zip Updated: Tuesday, November 1, 2011 at 12:44 PM

Related Web Link(s):

http://en.wikipedia.org/wiki/Representational_state_transfer
http://www.twilio.com

Known Limitations: None

Excerpt of article text...

In issue 9.4, I commented that it would be really useful if Real Studio Web Edition could return simple data back to the client without embedding its JavaScript framework. It turns out this capability was added in Real Studio 2011 Release 2 with the App.HandleSpecialURL event.

App.SpecialHandleURL

This event allows your web application to handle specific URLs differently. These URL are ones that are within the path "/special". For example, when running locally, URLs that look like this would be handled by SpecialHandleURL:

http://127.0.0.1:8080/special/123

There is only a single parameter to this event: Request As WebRequest which will contain everything you need to process the request.

This event is incredibly useful because it essentially allows you to use Real Studio Web Edition to make web services.

Simple Web Service

We will create a simple web service that will add two numbers and return the result as XML.

First, create a web application project. In App.SpecialhandleURL add this code:

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

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com