librelist archives

« back to archive

How do I make a url accept POST

How do I make a url accept POST

From:
Mahesh Lal
Date:
2012-06-19 @ 07:30
Hi,

I am trying to write an application using Flask and got a 405 on trying to
send POST data to a url.

How can I make the url accept POST requests?

I am using blueprints and not just app.add_url().

-- 
*-- REGARDS*
*

MAHESH LAL*
*
*

Re: How do I make a url accept POST

From:
Mahesh Lal
Date:
2012-06-19 @ 07:34
I should start more thorough reading.

Got the answer.

Thanks.

On Tue, Jun 19, 2012 at 1:00 PM, Mahesh Lal <mahesh.2910@gmail.com> wrote:

> Hi,
>
> I am trying to write an application using Flask and got a 405 on trying to
> send POST data to a url.
>
> How can I make the url accept POST requests?
>
> I am using blueprints and not just app.add_url().
>
> --
> *-- REGARDS*
> *
>
> MAHESH LAL*
> *
> *
>
>


-- 
*-- REGARDS*
*

MAHESH LAL*
*
*

Re: [flask] How do I make a url accept POST

From:
Igor Davydenko
Date:
2012-06-19 @ 07:38
@blueprint.route('/route', methods=('GET', 'POST'))
def view():
     pass

or

blueprint.add_url_rule('/route', methods=('GET', 'POST'))

more at http://flask.pocoo.org/docs/api/?highlight=route#url-route-registrations
and http://werkzeug.pocoo.org/docs/routing/#werkzeug.routing.Rule

On 19 June 2012 10:30, Mahesh Lal <mahesh.2910@gmail.com> wrote:
> Hi,
>
> I am trying to write an application using Flask and got a 405 on trying to
> send POST data to a url.
>
> How can I make the url accept POST requests?
>
> I am using blueprints and not just app.add_url().
>
> --
> -- REGARDS
>
> MAHESH LAL
>
>



-- 
Sincerely,
Igor Davydenko

Re: [flask] How do I make a url accept POST

From:
pronoyc@gmail.com
Date:
2012-06-19 @ 07:36
I think you need to specify methods

@app.route('/foo', methods=["POST,GET"])

On Tue, Jun 19, 2012 at 1:00 PM, Mahesh Lal <mahesh.2910@gmail.com> wrote:

> Hi,
>
> I am trying to write an application using Flask and got a 405 on trying to
> send POST data to a url.
>
> How can I make the url accept POST requests?
>
> I am using blueprints and not just app.add_url().
>
> --
> *-- REGARDS*
> *
>
> MAHESH LAL*
> *
> *
>
>


-- 
Regards,

Pronoy Chopra
http://blog.pronoy.in <http://www.pronoy.in/about>/
http://www.twitter.com/pronoyc