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 8992841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:03:04+00:00 2026-06-15T23:03:04+00:00

How do I encode form data to the url when using the Google App

  • 0

How do I encode form data to the url when using the Google App Engine?

The code below produces a form where you enter some text. The text is then displayed on another page "/sign"

Instead of directing to /sign I would like to direct to /sign?message="hello"

Here is my code, from here: https://developers.google.com/appengine/docs/python/gettingstartedpython27/handlingforms)

import cgi
import webapp2

from google.appengine.api import users

class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.out.write("""
          <html>
            <body>
              <form action="/sign" method="post">
                <div><textarea name="content" rows="3" cols="60"></textarea></div>
                <div><input type="submit" value="Sign Guestbook"></div>
              </form>
            </body>
          </html>""")


class Guestbook(webapp2.RequestHandler):
    def post(self):
        self.response.out.write('<html><body>You wrote:<pre>')
        self.response.out.write(cgi.escape(self.request.get('content')))
        self.response.out.write('</pre></body></html>')

app = webapp2.WSGIApplication([('/', MainPage),
                              ('/sign', Guestbook)],
                              debug=True)
  • 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-15T23:03:05+00:00Added an answer on June 15, 2026 at 11:03 pm

    I’m not enterally sure what your trying to achieve. You might get more solid advice if you wrote about your intentions.

    To get the result I think your describing you will need to use get instead of post. Get will alter the url. Here is the modified code:

    import cgi
    import webapp2
    
    from google.appengine.api import users
    
    class MainPage(webapp2.RequestHandler):
        def get(self):
            self.response.out.write("""
              <html>
                <body>
                  <form action="/sign">
                    <div><textarea name="content" rows="3" cols="60"></textarea></div>
                    <div><input type="submit" value="Sign Guestbook"></div>
                  </form>
                </body>
              </html>""")
    
    
    class Guestbook(webapp2.RequestHandler):
        def get(self):
            self.response.out.write('<html><body>You wrote:<pre>')
            self.response.out.write(cgi.escape(self.request.get('content')))
            self.response.out.write('</pre></body></html>')
    
    
    app = webapp2.WSGIApplication([('/', MainPage),
                                  ('/sign', Guestbook)],
                                  debug=True)
    

    If your looking to learn more about webapp2 and the get and post method check out udacity CS253

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

Sidebar

Related Questions

I have a Google app engine in python form submit that POSTS text to
I am trying to grab some data from Delicious, using URL class, URL url
I want to base64 encode data to put it in a URL and then
I'm trying to URL encode a string to form a GET request from objective-c.
Under ARC, is it possible to encode/decode a CGMutablePathRef (or its non-mutable form) using
I have a form that posts some data to a PHP processing script. I
Im trying to shorten a url using ggole api's.Here is my php code .It
I'm used to send passing data with the jQuery form pluging using data: $(form#myform).serialize()
I'm using Webex's URL API and for some reason, when writing a simple PHP
I have the following code which I'm using to populate form fields. This code

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.