Hi Yann,

There is an implicit conversion from a status code & entity tuple, thus 
this should work:
  complete(Created -> ast)

Similarly you can provide a Tuple3 with status code, response headers and 
entity.

Agree that the current API doesn't make this obvious.

Mark


On Tuesday, March 10, 2015 at 5:09:11 PM UTC, Yann Simon wrote:
>
> Hi,
>
> by using:
> import akka.http.marshallers.sprayjson.SprayJsonSupport._
> import spray.json.DefaultJsonProtocol._
>
> I can complete a http response with complete(ast) and the ast value is 
> marshalled into JSON.
>
> This response is default with the HTTP code OK.
> I'd like the change the HTTP code to Created for example.
> How can I do that?
>
> If I use:
> complete(HttpResponse(status = Created, entity = ast))
> it does not compile.
>
> I tried to find my way between all implicit conversions 
> to ToResponseMarshallable, ToResponseMarshaller and co and cannot find a 
> solution.
>
> Maybe somebody more experienced than me can guide me here?
>
> Cheers,
> Yann
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to