Request Parameters

37 views
Skip to first unread message

Maatary Okouya

unread,
Feb 12, 2015, 5:30:28 PM2/12/15
to spray...@googlegroups.com
Hi, 

quick stupid question. Are request parameters to be part of the provided uri, or there are construct for it?  (Client side)


This leads also to the following question: On the server side, is there anything to help in reading parameters and deconstructing them ?


Sample URI with parameter

Maatary Okouya

unread,
Feb 16, 2015, 3:37:57 PM2/16/15
to spray...@googlegroups.com
I found in spray routing the handling of parameters. 

My client code works fine if i use an URL with my parameter into it. I'm just wondering is there is a facility similar to the server side, to deal with parameter but from the construction perspective. I mean if it exist i would rather use it. 

Best,

D

Mathias Doenitz

unread,
Feb 17, 2015, 7:18:31 AM2/17/15
to spray...@googlegroups.com
Maatary,

maybe you are looking for this?:
http://spray.io/documentation/1.2.2/spray-routing/parameter-directives/

Cheers,
Mathias

---
mat...@spray.io
http://spray.io
> --
> You received this message because you are subscribed to the Google Groups "spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spray-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/0c9e02cd-2daa-47c3-9e37-628f288b2999%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Maatary Okouya

unread,
Feb 17, 2015, 10:58:49 AM2/17/15
to spray...@googlegroups.com
Thanks Mathias,

I found it before. I was wondering if there was some facility on the client side. This is for deconstructing, I was wondering if they were facility for constructing the URL with the parameter. Like what you have for header, multi-part, authentification and etc....

Mathias Doenitz

unread,
Feb 17, 2015, 11:22:20 AM2/17/15
to spray...@googlegroups.com
Maatary,

on the client side simply use the existing constructors for a `URI`, which allow you to specify each component individually.
Or simply use a modifier, like this

Uri(“http://example.com/path/”).withQuery(Query(“foo” -> “bar”, “baz” -> “42”))

There are many options.
Simply browse through the API.

Cheers,
Mathias

---
mat...@spray.io
http://spray.io

> To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/05d4480a-262c-4beb-94df-aa060dcfe7e2%40googlegroups.com.

Maatary Okouya

unread,
Feb 17, 2015, 3:47:21 PM2/17/15
to spray...@googlegroups.com
Many thanks Mathias.
Reply all
Reply to author
Forward
0 new messages