P.S. By headless, i mean no browser involved...

On Mon, Feb 15, 2010 at 1:34 PM, Meredith Gregory
<[email protected]>wrote:

> Dear David,
>
> Thanks!
>
> So, what's the recommended way of building a headless RESTful webservice
> that takes parameters?
>
> Best wishes,
>
> --greg
>
>
> On Mon, Feb 15, 2010 at 1:26 PM, David Pollak <
> [email protected]> wrote:
>
>>
>>
>> On Mon, Feb 15, 2010 at 1:23 PM, Meredith Gregory <
>> [email protected]> wrote:
>>
>>> Dear Lifted,
>>>
>>> Here are some steps to create the observed behavior.
>>>
>>>    - Create an instance of the lift basic archetype
>>>
>>> put the following script into mklift.sh
>>> #! /bin/sh
>>> mvn archetype:generate -U                                   \
>>>  -DarchetypeGroupId=net.liftweb                             \
>>>  -DarchetypeArtifactId=lift-archetype-basic                 \
>>>  -DarchetypeVersion=2.0-scala280-SNAPSHOT                   \
>>>  -DarchetypeRepository=http://scala-tools.org/repo-snapshots \
>>>  -DremoteRepositories=http://scala-tools.org/repo-releases  \
>>>  -DgroupId=$1 -DartifactId=$2
>>>
>>> > mklift.sh org.my.lift thingy
>>>
>>>
>>>    - Modify Boot.scala by adding the following code to the Boot class
>>>
>>> def dispatch: LiftRules.DispatchPF = {
>>>       case req @ Req(
>>> List(
>>>   "biosimilarity-services",
>>>   "grammar",
>>>   grammar
>>>  ), "", GetRequest) => {
>>>   println( "***** What is going on HERE *****" )
>>>   () => Full(
>>>     PlainTextResponse(
>>>       grammar + "\n",
>>>       List( "Content-Type" -> "text/plain; charset=UTF-8" ),
>>>       200
>>>     )
>>>   )
>>>       }
>>>     }
>>>
>>>     LiftRules.dispatch.prepend(dispatch)
>>>
>>>
>>>    - Start up lift
>>>
>>> > mvn clean compile jetty:run
>>>
>>>
>>>    - Call curl
>>>
>>> > curl -o test.txt
>>> http://localhost:8080/biosimilarity-services/grammar/banana-cream-pie#file=file://
>>> <pathToFile>
>>>
>>>
>>> i expected to find text.txt containing:
>>> banana-cream-pie#file=file://<pathToFile>
>>>
>>> However, it contains banana-cream-pie. This means that the fragment is
>>> being dropped. How do i get the fragment?
>>>
>>
>> You don't.  According to the HTTP spec, the stuff that comes after the #
>> is not passed to the server (you can verify this with Wireshark).  The # and
>> what comes after it is client side only.
>>
>>
>>>
>>> Best wishes,
>>>
>>> --greg
>>>
>>> --
>>> L.G. Meredith
>>> Managing Partner
>>> Biosimilarity LLC
>>> 1219 NW 83rd St
>>> Seattle, WA 98117
>>>
>>> +1 206.650.3740
>>>
>>> http://biosimilarity.blogspot.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Lift" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<liftweb%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/liftweb?hl=en.
>>>
>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Surf the harmonics
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<liftweb%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
>
> --
> L.G. Meredith
> Managing Partner
> Biosimilarity LLC
> 1219 NW 83rd St
> Seattle, WA 98117
>
> +1 206.650.3740
>
> http://biosimilarity.blogspot.com
>



-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+1 206.650.3740

http://biosimilarity.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to