Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Problem mapping a request for a REST Api
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
andythedestroyer  
View profile  
 More options Oct 29, 5:27 pm
From: andythedestroyer <andythedestro...@gmail.com>
Date: Thu, 29 Oct 2009 14:27:10 -0700 (PDT)
Local: Thurs, Oct 29 2009 5:27 pm
Subject: Problem mapping a request for a REST Api
Hello,

I am creating a rest api for an app and am having trouble extracting a
var from the matched request.

Object MyApi extends XMLHelperApi {
     def dispatch : LiftRules.DispatchPF = {
           case Req(List("api","package", packageName), _, GetRequest)
=>
                 () => myMethodThatDoesSomething(packageName)
     }

}

The packageName variable is in the form similar but not exactly like
java package names ( my.company.package:key=value )

so the rest url would be

http://domain.com/api/package/my.company.package%3Akey%3Dvalue

This should work and the package var in my case expression should be
"my.company.package:key=value" but it is just "my".

I have gone through "The Definitive Guide to Lift" and the group
postings but have had no luck so far. I know this should be easy and I
am just missing something.

Thanks
Andy


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Naftoli Gugenheim  
View profile  
 More options Oct 29, 5:32 pm
From: Naftoli Gugenheim <naftoli...@gmail.com>
Date: Thu, 29 Oct 2009 14:32:02 -0700 (PDT)
Local: Thurs, Oct 29 2009 5:32 pm
Subject: Re: [Lift] Problem mapping a request for a REST Api
List("api", "package", packageName : _* )

-------------------------------------

andythedestroyer<andythedestro...@gmail.com> wrote:

Hello,

I am creating a rest api for an app and am having trouble extracting a
var from the matched request.

Object MyApi extends XMLHelperApi {
     def dispatch : LiftRules.DispatchPF = {
           case Req(List("api","package", packageName), _, GetRequest)
=>
                 () => myMethodThatDoesSomething(packageName)
     }

}

The packageName variable is in the form similar but not exactly like
java package names ( my.company.package:key=value )

so the rest url would be

http://domain.com/api/package/my.company.package%3Akey%3Dvalue

This should work and the package var in my case expression should be
"my.company.package:key=value" but it is just "my".

I have gone through "The Definitive Guide to Lift" and the group
postings but have had no luck so far. I know this should be easy and I
am just missing something.

Thanks
Andy


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Oct 29, 6:12 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Thu, 29 Oct 2009 15:12:11 -0700
Local: Thurs, Oct 29 2009 6:12 pm
Subject: Re: [Lift] Problem mapping a request for a REST Api

When Lift parses a path, the last element of the path is split at the first
'.'.  This allows you to match of "foo" :: "bar", "jpg" vs. "foo" :: "bar",
"png"

However, this is biting you right now... and  I've got a solution.

Please open a ticket at http://github.com/dpp/liftweb/issues and I'll get it
fixed.

On Thu, Oct 29, 2009 at 2:27 PM, andythedestroyer <

--
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

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andythedestroyer  
View profile  
 More options Oct 29, 6:39 pm
From: andythedestroyer <andythedestro...@gmail.com>
Date: Thu, 29 Oct 2009 15:39:53 -0700 (PDT)
Local: Thurs, Oct 29 2009 6:39 pm
Subject: Re: Problem mapping a request for a REST Api
Thanks for the response but that doesn't work. I get the following
error.

[WARNING] API.scala:51: error: ')' expected but identifier found.
[WARNING]     case Req(List("api" , "package" , packageName : _*), "",
GetRequest) =>

-Andy

On Oct 29, 2:32 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andythedestroyer  
View profile  
 More options Oct 29, 6:41 pm
From: andythedestroyer <andythedestro...@gmail.com>
Date: Thu, 29 Oct 2009 15:41:32 -0700 (PDT)
Local: Thurs, Oct 29 2009 6:41 pm
Subject: Re: Problem mapping a request for a REST Api
Thanks for the response. The ticket number is 144 and here is the link
http://github.com/dpp/liftweb/issues/#issue/144

-Andy

On Oct 29, 3:12 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Oct 29, 7:23 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Thu, 29 Oct 2009 16:23:11 -0700
Local: Thurs, Oct 29 2009 7:23 pm
Subject: Re: [Lift] Re: Problem mapping a request for a REST Api

On Thu, Oct 29, 2009 at 3:41 PM, andythedestroyer <

andythedestro...@gmail.com> wrote:

> Thanks for the response. The ticket number is 144 and here is the link
> http://github.com/dpp/liftweb/issues/#issue/144

I've got a fix that I'm testing.  I hope to get it into the code before the
code slush today.

--
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

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andythedestroyer  
View profile  
 More options Oct 29, 7:54 pm
From: andythedestroyer <andythedestro...@gmail.com>
Date: Thu, 29 Oct 2009 16:54:43 -0700 (PDT)
Local: Thurs, Oct 29 2009 7:54 pm
Subject: Re: Problem mapping a request for a REST Api
You rule!

On Oct 29, 4:23 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Pollak  
View profile  
 More options Oct 29, 7:57 pm
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Thu, 29 Oct 2009 16:57:51 -0700
Local: Thurs, Oct 29 2009 7:57 pm
Subject: Re: [Lift] Re: Problem mapping a request for a REST Api

http://reviewboard.liftweb.net/r/77/

On Thu, Oct 29, 2009 at 4:54 PM, andythedestroyer <

--
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

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Naftoli Gugenheim  
View profile  
 More options Oct 30, 12:17 am
From: Naftoli Gugenheim <naftoli...@gmail.com>
Date: Thu, 29 Oct 2009 21:17:41 -0700 (PDT)
Local: Fri, Oct 30 2009 12:17 am
Subject: Re: [Lift] Re: Problem mapping a request for a REST Api
Sorry--it was a bad guess. I should have written "try" etc...

-------------------------------------

andythedestroyer<andythedestro...@gmail.com> wrote:

Thanks for the response but that doesn't work. I get the following
error.

[WARNING] API.scala:51: error: ')' expected but identifier found.
[WARNING]     case Req(List("api" , "package" , packageName : _*), "",
GetRequest) =>

-Andy

On Oct 29, 2:32 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andythedestroyer  
View profile  
 More options Oct 30, 7:28 pm
From: andythedestroyer <andythedestro...@gmail.com>
Date: Fri, 30 Oct 2009 16:28:02 -0700 (PDT)
Local: Fri, Oct 30 2009 7:28 pm
Subject: Re: Problem mapping a request for a REST Api
No problem. I sincerely appreciate all suggestions.

It looks like dpp is already working on a fix for this. I came up with
the really ugly ( but temporary solution until the fix in commited )
of appending meaningless info to the url.
so
http://domain.com/api/package/my.company.package%3Akey%3Dvalue

becomes

http://domain.com/api/package/my.company.package%3Akey%3Dvalue/foobar

and it works.

Thanks again,
A

On Oct 29, 9:17 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google