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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:44:35+00:00 2026-06-01T22:44:35+00:00

Problem: From jQuery i send a post request to server, the url i call

  • 0

Problem: From jQuery i send a post request to server, the url i call is something like this: /get_post_data/my-custom-slug meaning i make a request to localhost:8080/get_post_data/my-custom-slug. But this may change to /my-custom-slug-two depending upon where the user clicks in the template. I want the url router to catch the slug and the handler function for that url to get the slug and based on the slug, i would call some model in my database fetch some data and send it back.

Solution Strategy:
With the above in mind here is how i have designed my url router:

app = webapp2.WSGIApplication([('/', MainPage),
                               ('/get_post_data/<my_slug:[-\w]+>', PostData)
                               ],
                              debug=True)

and following is the url handler function:

class PostData(webapp2.RequestHandler):
  def post(self, my_slug):
    self.response.out.write(my_slug)

The trouble is:
Ideally the output should be my-custom-slug
but the trouble is i dont get the my_slug variable in the handler function.
Where am i wrong?

  • 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-01T22:44:36+00:00Added an answer on June 1, 2026 at 10:44 pm

    You are almost there, just put it this way: ('/get_post_data/([-\w]+)', TeamRates)
    make sure you put () and in the views as described above, things should work.

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

Sidebar

Related Questions

I have problem to send value from php to jQuery script. PHP looks like
I would like to send this textfield value to a php file using jQuery.
I use jQuery to send data from the client to the server and to
I have this code just to send data from already loaded jqGrid: jQuery(#bedata).click(function(){ //Function
I want to send some Data with tha $.ajax() method from JQuery. The problem
I have a problem with getting jquery to retrieve results from a WCF service.
Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is
I may be approaching this problem from the wrong angle but what I'm thinking
I have been working on the following problem from this book . A certain
Givens: One SQL Server is named: DevServerA Another is named: DevServerB\2K5 Problem: From DevServerA

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.