Project

General

Profile

Actions

Support #446

closed

Using wt for a RESTful API

Added by takashi yamamoto almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/21/2010
Due date:
% Done:

0%

Estimated time:

Description

I came across the wt toolkit a liitle while back and have been 'kicking the tires' a bit whenever I had some free time.

I have successfully written a 'hello world' wt application but rather than using wt as a web application, I want to use wt to implement a 'pure' web srevice.

I am thinking of using wt to provide to provide RESTful services from a C application. I have been looking for an example or two that will show how to build a RESTful API consisting of the following methods:

a). a method that returns a txt/html document

b). a method that returns an XML document

c). a method that returns a JSON string

d). a method that returns an octet stream (i.e. binary data)

Could anyone familiar enough with wt, demonstrate how I can write functions that return the various data types listed above, from my test application ?

[1]: http://www.webtoolkit.eu/wt

Actions #1

Updated by Koen Deforche almost 14 years ago

  • Tracker changed from Bug to Support
Actions #2

Updated by Koen Deforche almost 14 years ago

Hey,

You need to take a look at http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WResource.html.

In WResource::handleRequest() you have the complete freedom to generate a response of the appropriate type in response to a request.

Regards,

koen

Actions #3

Updated by Koen Deforche almost 14 years ago

  • Status changed from New to Resolved
Actions #4

Updated by Pieter Libin over 13 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF