My code looks like:
def dispatch: LiftRules.DispatchPF = {
case req@Req(List("twilio", "call"), "", _) => () =>
callResponse(req)
}
def callResponse(req: Req) = {
val xml = <Response>...</Response>
XmlResponse(xml)
}
Example repro:
scala> val r = XmlResponse(<a/>)
r: net.liftweb.http.XmlResponse =
net.liftweb.http.XmlResponse@5b425a8e
scala> r.toResponse
res6: net.liftweb.http.InMemoryResponse =
InMemoryResponse(<?xml version="1.0" encoding="UTF-8"?>
<a/>
, List(), List(), 200)
$ curl -i 'http://localhost:8080/twilio/call?pin=5156'
HTTP/1.1 200 OK
Expires: Fri, 2 Dec 2011 20:18:54 GMT
Content-Length: 621
Cache-Control: no-cache, private, no-store
Pragma: no-cache
Date: Fri, 2 Dec 2011 20:18:54 GMT
Server: Jetty(6.1.25)
<Response>...</Response>
Whereas JsonResponse, PlainTextResponse etc work fine:
scala> val j = JsonResponse("abc")
j: net.liftweb.http.LiftResponse =
JsonResponse(JsExp("abc"),List(),List(),200)
scala> j.toResponse
res12: net.liftweb.http.BasicResponse = InMemoryResponse("abc",
List((Content-Length,5), (Content-Type,application/json;
charset=utf-8)), List(), 200)
I was able to construct an InMemoryResponse as a workaround. This is
lift-2.8.1-2.4-M5.
Thanks,
Jason
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
Was a ticket created for this?
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
getResponseHeaders" seems to have a bug whereby if the _responseHeaders.value is either a null or empty box then the new values will not be appended to the list.On Tuesday, January 31, 2012 12:17:10 AM UTC-5, Andrew Mullins wrote:
So in XmlResponse, 'S.getResponseHeaders(("Content-Type" -> mime) :: addlHeaders)' does not appear to actually return anything which is why the Content-Type never appears.
-Josh
Done. http://www.assembla.com/spaces/liftweb/tickets/1191
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/tpg6F2Xln24/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.