On Friday, April 12, 2019 at 4:41:43 PM UTC-7, João Matos wrote:
>
> So no option for redirect with POST. That is a shame.
>
>
It's up to the client how an HTTP 303 is handled.  It's usually the case 
that a GET is used to retrieve a response that is ultimately from a POST 
request.

If 2 controller functions need to share data, use the session or a database 
entry.
 

> The book mentions request.post_vars. In what situation would one use it?
>
>
To retrieve the data the client sent in a POST request.

Logging in with AUTH often involves the following sequence:

client: GET resourceX
server: 303 pointing to user/login and setting an arg for _next [points to 
resourceX or a relevant object]
client: GET user/login
server 200 + page contents (login form)
client: POST login data (generally credentials in some form), arg _next in 
URL  [server sees this in request.post_vars]
server: 200 + page contents of resourceX

This description is like those arrow diagrams with client on the left, 
server on the right, and time flowing downwards; I've simplified the 
description, but 
I'm cribbing from my NginX logs; I think you've said you're stuck with 
Apache, which should show similar interactions in the form it's logs use.

The above exchange was with a browser for a client, but I have clients that 
use libcurl, and libcurl offers a choice of how to deal with 303's:  follow 
automatically,  or just report the new URL (or URI these days).  With the 
latter option, the URL can be examined (for validation, perhaps), and the 
client decides to request the new page based on its processing.

/dps


sábado, 13 de Abril de 2019 às 00:33:56 UTC+1, Dave S escreveu:
>
>
>
> On Friday, April 12, 2019 at 4:25:48 PM UTC-7, João Matos wrote:
>>
>> redirect
>>
>
>
> Then it is actually the client (browser?) that accesses the  other 
> function, you're just telling it where to make the new request (you can put 
> vars and args in the URL, but you don't control the method).  Can you put 
> something in the session (with pickle restrictions)?  Other thought:  a db 
> table just for the handing over of request data, and the redirect URL has a 
> single arg that specifies the row being handed over.  The number of rows 
> can be small because the consumer can delete a row when complete.
>
> /dps
>
>
>
>> sexta-feira, 12 de Abril de 2019 às 23:59:46 UTC+1, Dave S escreveu:
>>>
>>>
>>>
>>> On Friday, April 12, 2019 at 3:12:55 PM UTC-7, João Matos wrote:
>>>>
>>>> Is it possible to send all args and vars from a view/controller to 
>>>> another view/controller using POST instead of GET?
>>>>
>>>
>>> Is this as a redirect or a fetch?  fetch's 2nd argument, data, selects 
>>> for POST if not null, and urlencodes data's value.
>>>
>>> The redirect code doesn't seem to have a way change method, but then it 
>>> is primarily just for returning an HTTP 303 status.
>>>
>>> (See gluon/tools.py and gluon/http.py respectively)
>>>
>>> /dps
>>>  
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to