[Seaside-dev] new features in Seaside-REST: multi element matches and or matches

Norbert Hartl norbert at hartl.name
Fri Mar 25 21:57:42 UTC 2011


Create class

WAPragmaBasedRestfulHandler subclass: #RESTExample
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'REST-Example'

implement method

RESTExample>>getHello
	<GET>
	<Path: '/hello'>
	self requestContext response
		stream 
			nextPutAll: 'hi';
			nextPutAll: String crlf

(WAAdmin register: RESTExample at: 'rest-example')

If it doesn't work do

WAPragmaBasedRestfulHandler allSubInstances do: [:each| each initializeRoutes ]

On the shell do

silverflux:~ norbert$ curl http://localhost:8700/rest-example/hello
hi

that's all. If you change the handler you reinitialize. For documentation look at

http://code.google.com/p/seaside/wiki/SeasideRest

Norbert

Am 25.03.2011 um 22:20 schrieb Esteban Lorenzano:

> sorry, I'm trying to understand how this package works and I cannot figure out... is there an example somewhere?
> 
> cheers,
> Esteban
> 
> El 23/03/2011, a las 4:47p.m., Philippe Marschall escribió:
> 
>> Hi
>> 
>> The latest version of Seaside-REST supports multi element matches
>> (*argumentName*) and or matches ([option1|option1]). This allows you
>> to write matches like the following:
>> 
>> getFile: fileName at: pathTerms fromProject: projectName
>>   <GET>
>>   <Path: '/projects/{projectName}/*pathTerms*/{fileName}.mcz/[classes|methods]'>
>> 
>> You can find more examples and documentation at [1]
>> 
>> [1] http://code.google.com/p/seaside/wiki/SeasideRest
>> 
>> Cheers
>> Philippe
>> _______________________________________________
>> seaside-dev mailing list
>> seaside-dev at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
> 
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev



More information about the seaside-dev mailing list