percent-encoding

Uri.EscapeDataString weirdness

霸气de小男生 提交于 2019-11-30 04:47:06
问题 Why does EscapeDataString behave differently between .NET 4 and 4.5? The outputs are Uri.EscapeDataString("-_.!~*'()") => "-_.!~*'()" Uri.EscapeDataString("-_.!~*'()") => "-_.%21~%2A%27%28%29" The documentation By default, the EscapeDataString method converts all characters except for RFC 2396 unreserved characters to their hexadecimal representation. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the EscapeDataString method converts

URL component encoding in Node.js

℡╲_俬逩灬. 提交于 2019-11-29 11:26:38
问题 I want to send http request using node.js. I do: http = require('http'); var options = { host: 'www.mainsms.ru', path: '/api/mainsms/message/send?project='+project+'&sender='+sender+'&message='+message+'&recipients='+from+'&sign='+sign }; http.get(options, function(res) { console.log('STATUS: ' + res.statusCode); console.log('HEADERS: ' + JSON.stringify(res.headers)); }).on('error', function(e) { console.log('ERROR: ' + e.message); }); When my path like this: /api/mainsms/message/send?project

Changing “/” to “%2f” in URL doesn't work

感情迁移 提交于 2019-11-29 09:51:18
I have an orchard site and have the following problem: If I use the URL: http://asiahotelct.com/tours/ct---chau-%C4%91oc---ha-tien-3n2%C4%91 , it's okay. But when I change url the / to %2f (like so: http://asiahotelct.com/tours%2fct---chau-%C4%91oc---ha-tien-3n2%C4%91 ), it no longer works. Why can / not be replaced by %2f ? Any url is a kind of complete address to some resource(file) in network. But according to the rules of how it must be actually (to work as you expect), its expected that a few characters must have some specific meaning; just like in this case: "/" means a separator that

Uri.EscapeDataString behaves different in NUnit test vs. asp.net webservice?

爷,独闯天下 提交于 2019-11-28 13:07:10
I am using Uri.EncodeDataString to send a query string on a URL. The original string is: Photo($select=Name,Id) In my asp.net web service running in the VS2015 debugger, Uri.EncodeDataString will return: Photo(%24select%3DName%2CId) However, in an NUnit test running under the Resharper test runner in VS2015, it returns: Photo%28%24select%3DName%2CId%29 . Notice the difference in the encoding of the parentheses. Why are the parentheses encoded in the unit test but not in the web service? Shouldn't the parentheses be encoded in the web service? I'm running under .Net 4.6, so I shouldn't be

Using Perl, how do I decode or create those %-encodings on the web?

筅森魡賤 提交于 2019-11-28 11:03:16
I need to handle URI (i.e. percent) encoding and decoding in my Perl script. How do I do that? This is a question from the official perlfaq . We're importing the perlfaq to Stack Overflow . This is the official FAQ answer minus subsequent edits. Those % encodings handle reserved characters in URIs, as described in RFC 2396, Section 2 . This encoding replaces the reserved character with the hexadecimal representation of the character's number from the US-ASCII table. For instance, a colon, : , becomes %3A . In CGI scripts, you don't have to worry about decoding URIs if you are using CGI.pm .

Changing “/” to “%2f” in URL doesn't work

◇◆丶佛笑我妖孽 提交于 2019-11-28 03:13:16
问题 I have an orchard site and have the following problem: If I use the URL: http://asiahotelct.com/tours/ct---chau-%C4%91oc---ha-tien-3n2%C4%91, it's okay. But when I change url the / to %2f (like so: http://asiahotelct.com/tours%2fct---chau-%C4%91oc---ha-tien-3n2%C4%91), it no longer works. Why can / not be replaced by %2f ? 回答1: Any url is a kind of complete address to some resource(file) in network. But according to the rules of how it must be actually (to work as you expect), its expected

How can I see how the browser percent-encoded my URL? (which is not visible on address bar)

前提是你 提交于 2019-11-27 08:27:23
问题 When I paste a url containing some reserved characters to the address bar of IE, FF, Chrome, I see that it displays it as it is but as far as I understand in uses percent-encoding in the background. How can I see in IE, FF and Chrome how the browser encoded the url? Is it possible? P.S: The reason I want to check this is I have a feeling my url is encoded differently in IE and FF and Chrome -so that it only works in IE. 回答1: Put the URL into an HTML page, ie, <a href="www.example.com?param

Uri.EscapeDataString behaves different in NUnit test vs. asp.net webservice?

最后都变了- 提交于 2019-11-27 07:26:28
问题 I am using Uri.EncodeDataString to send a query string on a URL. The original string is: Photo($select=Name,Id) In my asp.net web service running in the VS2015 debugger, Uri.EncodeDataString will return: Photo(%24select%3DName%2CId) However, in an NUnit test running under the Resharper test runner in VS2015, it returns: Photo%28%24select%3DName%2CId%29 . Notice the difference in the encoding of the parentheses. Why are the parentheses encoded in the unit test but not in the web service?

How to prevent python requests from percent encoding my URLs?

独自空忆成欢 提交于 2019-11-27 04:13:47
I'm trying to GET an URL of the following format using requests.get() in python: http://api.example.com/export/?format=json&key=site:dummy+type:example+group:wheel #!/usr/local/bin/python import requests print(requests.__versiom__) url = 'http://api.example.com/export/' payload = {'format': 'json', 'key': 'site:dummy+type:example+group:wheel'} r = requests.get(url, params=payload) print(r.url) However, the URL gets percent encoded and I don't get the expected response. 2.2.1 http://api.example.com/export/?key=site%3Adummy%2Btype%3Aexample%2Bgroup%3Awheel&format=json This works if I pass the

How to prevent python requests from percent encoding my URLs?

守給你的承諾、 提交于 2019-11-26 12:41:51
问题 I\'m trying to GET an URL of the following format using requests.get() in python: http://api.example.com/export/?format=json&key=site:dummy+type:example+group:wheel #!/usr/local/bin/python import requests print(requests.__versiom__) url = \'http://api.example.com/export/\' payload = {\'format\': \'json\', \'key\': \'site:dummy+type:example+group:wheel\'} r = requests.get(url, params=payload) print(r.url) However, the URL gets percent encoded and I don\'t get the expected response. 2.2.1 http: