简体   繁体   中英

Possible to find out if # in URL with python app engine

Is there a way to find out if the current URL for the webhandler contains a # ? I can't get written out the URL when i use a #. self.request.url returns only the base URL when a URL with # is GET on server.

I have also tried to send the rest of the URL as an argument and print that.

('/(.*)', MainHandler),
class MainHandler(webapp2.RequestHandler):
    def get(self, args):
        self.response.out.write(args)

This will not post anything on args argument when URL is GET with a # in the URL. For everything else it successfully writes the rest of the URL after the base. Example on what kind of URL i'm trying to show: http://instahashtag.appspot.com/#/14212311

Am i missing something here?

The URL fragment is handled by the browser and is not passed to the server. If you need to handle it you need to write client-side code (most likely in JavaScript).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM