controller code:

@auth.requires_login()
def call():
    session.forget()
    return service()

@service.json
def test():
    return ('Hello ',auth.user)


last few lines of curl output:

> GET /myapp/helper/call/json/test HTTP/1.1
> Host: localhost:8000
> Authorization: Basic xxxxxxxxxxxxxxxxxxxx
> User-Agent: curl/7.52.1
> Accept: */*
>
* STATE: DO => DO_DONE handle 0x800706e8; line 1680 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x800706e8; line 1807 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x800706e8; line 1817 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 403 FORBIDDEN
< Set-Cookie:  session_id_myapp=127.0.0.1-17e31147-bcfb-4c0e-a548-7db9f04dcefb; 
httponly; Path=/
< Content-Length: 14
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 23 Aug 2018 15:57:44 GMT
* Server Rocket 1.2.6 Python/2.6.6 is not blacklisted
< Server: Rocket 1.2.6 Python/2.6.6
< Connection: keep-alive
<
* STATE: PERFORM => DONE handle 0x800706e8; line 1981 (connection #0)
* multi_done
* Curl_http_done: called premature == 0
* Connection #0 to host localhost left intact
Not authorized                             

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to