url-encoding

How to URL encode strings in C#

点点圈 提交于 2019-11-30 22:49:40
问题 How can we encode a string using the URL (RFC 1738) standard in C#? The following online tool is converting the strings using this standard http://www.freeformatter.com/url-encoder.html An example of the string I want to convert is test(brackets) and the encoded string should look like: test%28brackets%29 回答1: According to RFC 1738: Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.

How secure is a HTTP GET when the data is URL Encoded?

我怕爱的太早我们不能终老 提交于 2019-11-30 20:56:49
If the data is Url Encoded, is it secure enough to send login credentials over HTTP GET? Not at all. URL encoded is easily reversible. You should encrypt the transport layer (i.e. use HTTPS) No - URL encoding is meant to make sure all the characters you try to send with a GET request can actually arrive at the other end. It is actually designed to be easily encoded and decoded to prepare data for transport, not for security. URL encoding is not any kind of encryption, it just prepares the string to be sent through the network. If your data is sensitive, GET should be completely out of question

How can I create a Wicket URL that hides its parameters?

ε祈祈猫儿з 提交于 2019-11-30 20:29:23
I'm currently creating a set of links with code like this: BookmarkablePageLink<CheeseMain> havarti = new BookmarkablePageLink<CheeseMain>("havarti", CheeseMain.class); havarti.setParameter("Title", "Havarti"); havarti.setParameter("Group", "cheeseName"); add(havarti); The URL that comes out has the format https://mysite.com/;jsessionid=B85EE5CB0349CCA2FE37AF76AB5C30C1?wicket:bookmarkablePage=:com.mycompany.cheese.CheeseMain&Title=Havarti&group=cheeseName . My problem is that I no longer want the URL for this link to be bookmarkable. Ideally, I would like it to be something simple like https:/

PHP sending encrypted data via the URL

泄露秘密 提交于 2019-11-30 19:05:07
I'm trying to send encrypted data over the url to another site (using file_get_contents("anotherUrl.php?hash=$encryptedString") . The problem is, sometimes, the encryption contains some special characters, like +, and this causes the decryption to fail. Here are my encryption / decryption methods: public function encrypt($string, $key) { return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)))); } public function decrypt($encrypted, $key) { return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted), MCRYPT_MODE_CBC

Getting Error in retrieving data from Google Spreadsheet API using Structure Query (sq) in Android

走远了吗. 提交于 2019-11-30 18:20:20
问题 I am working with Google Spreadsheet API in Android. I am successfully done with the integration and able to retrieve the rows. But facing a little problem in search functionality. I am having 3-4 different search for the spreadsheet. The problem is that in my spreadsheet in some columns I am having space between words. For e.g Hello World is a value in row number 5 and the header name for this row is let say test. So when i search for the Hello World it is throwing InValidEntryException :

Ampersands in URLRewriter Query Strings

烈酒焚心 提交于 2019-11-30 18:09:27
问题 I have a query string parameter value that contains an ampersand. For example, a valid value for the parameter may be: a & b When I generate the URL that contains the parameter, I'm using System.Web.HTTPUtility.UrlEncode() to make each element URL-friendly. It's (correctly) giving me a URL like: http://example.com/foo?bar=a+%26b The problem is that ASP.NET's Request object is interpreting the (encoded) ampersand as a Query String parameter delimiter, and is thus splitting my value into 2

In Java, using HttpPost (apache commons HttpClient) when sending JSON POST - should I URL encode the body?

你。 提交于 2019-11-30 16:08:10
问题 I'm sending a RESTful JSON POST request using Apache HttpClient (to a 3rd party API) Should I URL encode the JSON body? And if something in the content is already URL encoded (e.g. I send HTML that has some links with URL encoded chars, e.g. @22) should I expect to get the content as is on the other side without it being decoded? E.g. if i'm doing something like this String html = "<a href='http://example.com?charOfTheDay=%22'>click me</a>"; // Build the JSON object JSONObject jsonObj = new

UTF-8 percentage encoding and python

邮差的信 提交于 2019-11-30 16:04:48
问题 I'm trying to get python to give me percent encoded strings. The API I'm interacting with (which I think is using percent encoded UTF-8), gives %c3%ae for î. However, python's urllib.quote gives %3F. import urllib mystring = "î" print urllib.quote(mystring) print urllib.quote_plus(mystring) print urllib.quote(mystring.encode('utf-8')) Any help appreciated. 回答1: Your file has to encode your string as utf-8 before quoting it, and the string should be unicode. Also you have to specify the

UTF-8 percentage encoding and python

人走茶凉 提交于 2019-11-30 15:31:44
I'm trying to get python to give me percent encoded strings. The API I'm interacting with (which I think is using percent encoded UTF-8), gives %c3%ae for î. However, python's urllib.quote gives %3F. import urllib mystring = "î" print urllib.quote(mystring) print urllib.quote_plus(mystring) print urllib.quote(mystring.encode('utf-8')) Any help appreciated. Your file has to encode your string as utf-8 before quoting it, and the string should be unicode. Also you have to specify the appropriate file encoding for your source file in the coding section: # -*- coding: utf-8 -*- import urllib s = u

How to encode URL in Groovy?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 10:41:31
Is there a kind of URLEncode in Groovy? I can't find any String → String URL encoding utility. Example: dehydrogenase (NADP+) → dehydrogenase%20(NADP%2b) ( + instead of %20 would also be acceptable, as some implementations do that) aiolos You could use java.net.URLEncoder . In your example above, the brackets must be encoded too: def toEncode = "dehydrogenase (NADP+)" assert java.net.URLEncoder.encode(toEncode, "UTF-8") == "dehydrogenase+%28NADP%2B%29" You could also add a method to string's metaclass: String.metaClass.encodeURL = { java.net.URLEncoder.encode(delegate, "UTF-8") } And simple