Not to worry, already upgraded all my servers

On Wed, Mar 6, 2013 at 11:58 PM, Niphlod <niph...@gmail.com> wrote:
> If on old version, you can zero out the xxxx returning an iterator (or a
> list) instead of the body, i.e
> raise HTTP(401, [json.dumps(whatever)])
> vs
> raise HTTP(401, json.dumps(whatever))
>
>
> On Wednesday, March 6, 2013 12:15:07 PM UTC+1, Alec Taylor wrote:
>>
>> 401 was actually the error code that would be relevant there.
>>
>> Surprised that the XML comments were removed in 2.4.2; had been
>> tracing the commits. Just checked and noticed I am on 02.21.10.15.58
>> and it was fixed in 02.22.18.44.48 >.<
>>
>> Thanks for the other tips; should be helpful :D
>>
>> On Wed, Mar 6, 2013 at 9:57 PM, Ricardo Pedroso <rmdpe...@gmail.com>
>> wrote:
>> > On Wed, Mar 6, 2013 at 9:43 AM, Alec Taylor <alec.t...@gmail.com> wrote:
>> >> Oh, looks like it works on an endpoint level; not sure how to get rid
>> >> of the XML style comment though <!-- -->
>> >>
>> >> Output from curl:
>> >>
>> >>> GET /arbg/error HTTP/1.1
>> >>> Host: localhost
>> >>> Accept: */*
>> >>>
>> >>
>> >> < HTTP/1.1 404 NOT FOUND
>> >> < Set-Cookie:
>> >> session_id_arbg=127.0.0.1-d5613ca1-ff65-4c0e-a5ce-737c6024655d;
>> >> Path=/
>> >> < Content-Length: 555
>> >> < Content-Type: text/html; charset=UTF-8
>> >> < Date: Wed, 06 Mar 2013 09:39:20 GMT
>> >> < Server: Rocket 1.2.6 Python/2.7.3
>> >> < Connection: keep-alive
>> >> <
>> >> {"error": "unauthorized_client"}<!--
>> >>
>> >> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> >> //-->
>> >
>> > I started using this:
>> >
>> > raise HTTP(status, body, None, **{'Content-Type': 'application/json'})
>> >
>> > where
>> >   status - an HTTP status code (200, 404, 500, ...)
>> >   body - a json.dumps("something")
>> >
>> > This way I don't need to put a .json extension in the end of url
>> >
>> > To get rid of those xxx's you can upgrade to 2.4.2
>> >
>> > Note: web2py return a "Content-Type: text/plain; charset=utf-8" when
>> > using a .json extension
>> > I think it for max compatibility.
>> >
>> > PS: In your example your are issuing a 404 where a 403 would be a better
>> > fit
>> >
>> > Ricardo
>> >
>> > --
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups "web2py-users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to web2py+un...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

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


Reply via email to