Introduce Ning Client

Done

On Fri, Sep 19, 2014 at 5:04 PM, Michael Reed <notifications@github.com>
wrote:

> In core/src/main/scala/core/generator/ning/NingClientGenerator.scala:
>
> > +      queryParameters.foreach { pair =>
> > +        request.addQueryParameter(pair._1, pair._2)
> > +      }
> > +
> > +      val requestWithParamsAndBody = body.fold(request) { b =>
> > +        val serialized = play.api.libs.json.Json.stringify(b)
> > +        request.setBody(serialized).addHeader("Content-type", "application/json")
> > +      }
> > +
> > +      val finalRequest = requestWithParamsAndBody.build()
> > +      _logRequest(finalRequest)
> > +
> > +      val result = scala.concurrent.Promise[com.ning.http.client.Response]()
> > +      asyncHttpClient.executeRequest(finalRequest,
> > +        new AsyncCompletionHandler[Unit]() {
> > +          override def onCompleted(r: com.ning.http.client.Response) = result.success(r)
>
> you should also add
> override def onThrowable(t: Throwable) = result.failure(t)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/gilt/apidoc/pull/160/files#r17809429>.
>