I need to get all parameters from the request including what comes after "#". example: request: http://myserver/m#q=abc I need my server to get all parameters after "#" as they where after "?" How can i do that? 10x, Koby
Anchors or URL fragments as they are referred to in RFC 1738, are not sent by the client to the server, when requesting for a resource. The rationale is that fragment URLs are utilized to identify a location within a resource and not a different resource on the server. In order to identify the location in the resource, the client needs to fetch the complete resource from the server, and this process need not involve transfer of information about the fragment (as it does not mean anything to the server).
If you do wish to submit information via the query string using a URL containing a fragment, you will have to ensure that the querystring precedes the URL fragment. This might be a bug in your client-side code, if you're constructing the request on your own. Leave the request construction logic to the browser, if you can afford to do so.
If you do wish to send the fragment character (#) to the server, then you'll need to encode it in the query string, or the client(browser) will simply ignore that section of the URL when it sends the request to the server.
Related Questions on SO
Have in mind that anchors are a client-side concept so they shouldn't be used in the server side. Clients don't send the anchor data to the server, so you can't do this. Better use get parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With