Re: [dispatch-scala] [dispatch 0.11.2] Http vs. http

85 views
Skip to first unread message

Nathan Hamblen

unread,
Nov 20, 2014, 8:04:13 AM11/20/14
to Normen Müller, dispatc...@googlegroups.com

Just so that if you later need to customize the client, you don't have to update all the references to it.

On Nov 20, 2014 7:22 AM, Normen Müller <normen....@gmail.com> wrote:
Hi,

Nathan once suggested to use

val http = Http()
http(req1 OK as.String)
http(req2 OK as.String)

rather than

Http(req1 OK as.String)
Http(req2 OK as.String)

Why?

Best, /nm

--
You received this message because you are subscribed to the Google Groups "Dispatch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dispatch-scal...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

"Dr. Normen Müller"

unread,
Nov 21, 2014, 3:04:35 AM11/21/14
to Nathan Hamblen, dispatc...@googlegroups.com
Hi Nathan,

thanks for the reply. Just to make sure, with customisation you refer to the usage of the respective case class, right?

val http = new Http(client = <some other AsyncHttpClient>)
http(req1 OK.asString)
http(req2 OK.asString)

Best, /nm

Nathan Hamblen

unread,
Nov 21, 2014, 8:03:10 AM11/21/14
to Dr. Normen Müller, dispatc...@googlegroups.com

Yes, that's right.

Devon Miller

unread,
Nov 25, 2015, 8:34:57 AM11/25/15
to Dispatch, normen....@gmail.com
I typically need to add filters so I use the following alot:

val myADFilter = new ADFilter(...)
val adhttp = Http.configure(_.addRequestFilter(myADFilter))

and then use adhttp throughout.
Reply all
Reply to author
Forward
0 new messages