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

  • Home
  • SEARCH
  • 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 8840803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:33:00+00:00 2026-06-14T10:33:00+00:00

Attempting to develop a python web service on the Google App Engine that will

  • 0

Attempting to develop a python web service on the Google App Engine that will handle data posted from an HTML form. Can someone please advise what I’m doing wrong? All files residing in the same directory on the desktop \helloworld.

OS: Win 7 x64
Python 2.7
Google App Engine (Local)

helloworld.py

import webapp2
import logging
import cgi

class MainPage(webapp2.RequestHandler):

  def post(self):
    self.response.headers['Content-Type'] = 'text/plain'
    form = cgi.FieldStorage()
    if "name" not in form:
      self.response.write('Name not in form')
    else:
      self.response.write(form["name"].value)

app = webapp2.WSGIApplication([('/', MainPage)],debug=False)

page.html

<html>
<body>
  <form action="http://localhost:8080" method="post">
    Name: <input type="text" name="name"/>
    <input type="submit" value="Submit"/>
  </form>
</body>
</html>

Using a browser (Chrome) viewing the page.html, I input a text into the field and press submit, I expect to see the text being displayed in the browser, but I get “Name not in form”. It works if I change the HTML form method to get and the python function to def get(self), but I would like to use the post method. Any help with explanation would be appreciated.

  • 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-14T10:33:01+00:00Added an answer on June 14, 2026 at 10:33 am

    You shouldn’t be using cgi.FieldStorage. Webapp2, like all web frameworks, has a built-in way of handling POST data: in this case, it’s through request.POST. So your code should just be:

    if "name" not in self.request.POST:
        self.response.write('Name not in form')
    else:
        self.response.write(self.request.POST["name"]) 
    

    See the webapp2 documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to create a web app that works with business data models, pretty
I am attempting to develop an Android app that allows a user to write
I am attempting to develop a service that contains numerous client and server sockets
The self-extracting executable that I'm attempting to develop is an installer. An end-user will
I'm attempting to develop my first Facebook app that is designed to allow clients
I'm attempting to develop an application that scapes html of a site for relevant
I am attempting to develop an SQL field that is the sum of all
I am attempting to develop a Play 2.0 web application alongside a core Java
Attempting to use the data series from this example no longer passes the JSONLint
Attempting to make a NSObject called 'Person' that will hold the login details for

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.