The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

How does slim handle percentage symbol (%)?

osindiateam's Avatar

osindiateam

17 May, 2012 07:33 PM

When I use % in the URL, I get:

 Bad Request
 Your browser sent a request that this server could not understand.

Is this something Slim should handle or its a server side setup. What I want is to be either take the URL and send a proper error message, if its %%%, or let Slim handle it.

Any ideas?

If neither of these is possible, I would have to setup a custom page to send a proper message in a JSON string to client.

  1. 1 Posted by osindiateam on 18 May, 2012 06:35 PM

    osindiateam's Avatar

    Also, its ignoring + symbols in URI.
    For instance, if I give

      /Products/Microsoft+/
    

    It still returns as

      /Products/Microsoft/
    

    Is it expected?

  2. Support Staff 2 Posted by Josh Lockhart on 18 May, 2012 06:37 PM

    Josh Lockhart's Avatar

    If you want to include literal "%" or "+" characters in your URL, you need to URL encode them; otherwise, they assume a different meaning... "+" = space, and "%" is used for URL encoded characters.

  3. 3 Posted by osindiateam on 18 May, 2012 08:00 PM

    osindiateam's Avatar

    Thanks, Josh. The API I am developing is used on Mobile. Understand that they need to encode the URL and then call. But I wasn't sure what happens if those are passed as is. In this case, slim is just ignoring them.

  4. Andrew Smith closed this discussion on 02 Aug, 2012 11:03 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac