Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7838583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:09:00+00:00 2026-06-02T15:09:00+00:00

There is a need to make POST request from server side in Flask. Let’s

  • 0

There is a need to make POST request from server side in Flask.

Let’s imagine that we have:

@app.route("/test", methods=["POST"])
def test():
    test = request.form["test"]
    return "TEST: %s" % test

@app.route("/index")
def index():
    # Is there something_like_this method in Flask to perform the POST request?
    return something_like_this("/test", { "test" : "My Test Data" })

I haven’t found anything specific in Flask documentation. Some say urllib2.urlopen is the issue but I failed to combine Flask and urlopen. Is it really possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:09:02+00:00Added an answer on June 2, 2026 at 3:09 pm

    Yes, to make a POST request you can use urllib, see the documentation.

    I would however recommend to use the requests module instead.

    EDIT:

    I suggest you refactor your code to extract the common functionality:

    @app.route("/test", methods=["POST"])
    def test():
        return _test(request.form["test"])
    
    @app.route("/index")
    def index():
        return _test("My Test Data")
    
    def _test(argument):
        return "TEST: %s" % argument
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine we have a server side application that generates streaming content full of JavaScript
I need to make a nodejs client application that can send a POST request
There is a weird code here that I need to make work.. can you
Hi There I need to get the names and values of checkboxes that have
I need to make an AJAX request to some script from the onSave event
I need to send a HTTP request (and get XML response) from Flash that
I want to make some request from iPhone app to my web service (Rails)
I need to send an ajax POST request to my server. I'll need to
Hey, I need to make a HTTP POST request with an array of NSDictionary
I am enhancing an existing JSF app. There I need to add ExtGWT component

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.