URL Encoding using C#

I have an application which sends a POST request to the VB forum software and logs someone in (without setting cookies or anything). Once the user is logged in I create a variable that creates a path on their local machine. c:\tempfolder\date\username The problem is that some usernames are throwing “Illegal chars” exception. For example … Read more

What is %2C in a URL?

In a URL, what does the %2C encoding mean and it uses?. 7 s 7 Check out http://www.asciitable.com/ Look at the Hx, (Hex) column; 2C maps to , Any unusual encoding can be checked this way +—-+—–+—-+—–+—-+—–+—-+—–+ | Hx | Chr | Hx | Chr | Hx | Chr | Hx | Chr | +—-+—–+—-+—–+—-+—–+—-+—–+ … Read more

How to urlencode a querystring in Python?

I am trying to urlencode this string before I submit. queryString = ‘eventName=” + evt.fields[“eventName”] + “&’ + ‘eventDescription=’ + evt.fields[“eventDescription”]; 14 s 14 Python 2 What you’re looking for is urllib.quote_plus: safe_string = urllib.quote_plus(‘string_of_characters_like_these:$#@=?%^Q^$’) #Value: ‘string_of_characters_like_these%3A%24%23%40%3D%3F%25%5EQ%5E%24′ Python 3 In Python 3, the urllib package has been broken into smaller components. You’ll use urllib.parse.quote_plus (note … Read more

Java URL encoding of query string parameters

Say I have a URL http://example.com/query?q= and I have a query entered by the user such as: random word £500 bank $ I want the result to be a properly encoded URL: http://example.com/query?q=random%20word%20%A3500%20bank%20%24 What’s the best way to achieve this? I tried URLEncoder and creating URI/URL objects but none of them come out quite right. … Read more

Encode URL in JavaScript?

How do you safely encode a URL using JavaScript such that it can be put into a GET string? var myUrl = “http://example.com/index.html?param=1&anotherParam=2”; var myOtherUrl = “http://example.com/index.html?url=” + myUrl; I assume that you need to encode the myUrl variable on that second line? 2 21 Check out the built-in function encodeURIComponent(str) and encodeURI(str). In your … Read more