url-encoding

Pass in Active Directory user name (DOMAIN\etc) in asp.net MVC URL

£可爱£侵袭症+ 提交于 2019-12-24 19:29:31
问题 I'm trying to pass an active directory user name in to a asp.net MVC application, but can't figure out what's the best way to deal with the backslash in the user name. For example, say my user name is "EUROPE\george.collins" and I want my record for 2012: http://application/2012/EUROPE\George.Collins If I URL-encode the backslash as %5C the server is returning a "400 Bad Request". Should I just separate the DOMAIN and User Name parts, e.g. 2012/EUROPE/George.Collins? In that case, what would

AFNetworking GET parameters with JSON (NSDictionary) string contained in URL key parameter

烈酒焚心 提交于 2019-12-24 16:46:24
问题 This JSON string has to be sent: { "dashboard": "compact", "theme": "dark", "show_side_bar": "yes" } to a REST API using GET method in this format (since server retrieves data with this PHP code $_GET["setting"] ) with AFHTTPRequestOperationManager , such that the equivalent URL becomes: http://www.examplesite.com/api/change_setting?setting={ "dashboard" : "compact", "theme" : "dark", "show_side_bar" : "yes" } When I create an NSDictionary of parameters in AFHTTPRequestOperationManager 's GET

encode URI (spaces etc.), without encode non-ASCII characters

☆樱花仙子☆ 提交于 2019-12-24 16:09:19
问题 When I use escape/encodeURI/encodeURIComponent to encode URI, it's encoding special characters (like "? [ ] &" ), and all non-ASCII characters. I prefer the link to look like: http:/site.com/?tm=ДОБРОЕ**%20**УТРО instead: http:/site.com/?tm=%u0414%u041E%u0411%u0420%u041E%u0415**%20**%u0423%u0422%u0420%u041E My questions: Is there any need to encode non-ASCII ? Is there any function that encode only special characters ? (without non-ASCII) 回答1: Yes. No. In http://www.w3.org/Addressing/URL/5

Plus signs being replaced for %252520

有些话、适合烂在心里 提交于 2019-12-24 08:22:19
问题 When I click on my index'd pages in Google the plus signs in my query string are being replaced (encoded?) for %252520. Anyone know why? Example: lovelakedistrict.com/result/?q=Private%252520car%252520park&page=2 should be lovelakedistrict.com/result/?q=Private+car+park&page=2 I have heard that this is a result of redirecting my urls in htaccess? 回答1: If a space is used in the URI query, it must either be replaced by %20 (percent encoding) or by + (application/x-www-form-urlencoded content

MSExchange URL encoding

早过忘川 提交于 2019-12-24 02:47:10
问题 I am writing a PHP service to query an Exchange server via WebDAV. This service has been live for roughly a month with no issues, but experienced a hiccup today when an email with the following subject line arrived in the mailbox: FW: Daily Approval Report: Vendor/Master 007297 The message is stored in the file "FW: Daily Approval Report: Vendor/Master 007297.EML" and is referenced through a url as: FW:%20Daily%20Approval%20Report:%20Vendor_xF8FF_Master%20007297.EML I had been using the PHP

passing parameters without escaping in python3 requests

陌路散爱 提交于 2019-12-23 20:11:32
问题 I'm using the excellent requests package by Kenneth Retiz to make web requests. Requests Github repository Sometimes I need to pass in parameters that are comma separated, but the commas are not url encoded, i.e. my url would look like this http://example.site.com/customers?fields=id,first_name,last_name I can't figure out how to format the query parameters to come out like that. The comma always gets escaped to %2C. I've tried the following code, but that doesn't work: params['fields'] = 'id

passing parameters without escaping in python3 requests

大兔子大兔子 提交于 2019-12-23 19:50:28
问题 I'm using the excellent requests package by Kenneth Retiz to make web requests. Requests Github repository Sometimes I need to pass in parameters that are comma separated, but the commas are not url encoded, i.e. my url would look like this http://example.site.com/customers?fields=id,first_name,last_name I can't figure out how to format the query parameters to come out like that. The comma always gets escaped to %2C. I've tried the following code, but that doesn't work: params['fields'] = 'id

Regex - Greek Characters in URL

一个人想着一个人 提交于 2019-12-23 16:30:22
问题 I have a custom router that uses regex. The problem is that I cannot parse Greek characters. Here are some lines from index.php : $router->get('/theatre/plays', 'TheatreController', 'showPlays'); $router->get('/theatre/interviews', 'TheatreController', 'showInterviews'); $router->get('/theatre/[-\w\d\!\.]+', 'TheatreController', 'single_post'); Here are some lines from Router.php : $found = 0; $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); //get the url ////// Bla Bla Bla /////////

Does Windows have any built-in utility to encode/decode URL?

ぐ巨炮叔叔 提交于 2019-12-23 10:07:31
问题 The certutil utiliiy in Windows can be used to perform Base64 encoding and deocding. Is there any built-in utility for URL encoding and decoding? There are many free tools available on web. But I am specifically looking for Windows built-in utility or if not simple script that can run on Windows. Thanks! 回答1: Base64 VBA Base64 encoding and decoding can be done with VBA. You can copy/paste this code and put it in Excel VBA, for example, and then use it's methods to encode and decode Base64.

ASP.Net MVC: Passing a string parameter to an action using RedirectToAction()

血红的双手。 提交于 2019-12-23 08:04:15
问题 I would like to know how to pass a string parameter using RedirectToAction(). Let's say I have this route: routes.MapRoute( "MyRoute", "SomeController/SomeAction/{id}/{MyString}", new { controller = "SomeController", action = "SomeAction", id = 0, MyString = UrlParameter.Optional } ); And in SomeController, I have an action doing a redirection as follows: return RedirectToAction( "SomeAction", new { id = 23, MyString = someString } ); I tried this redirection with someString = "!@#$%?&* 1"