url-encoding

National characters in URI

妖精的绣舞 提交于 2020-01-24 16:17:35
问题 How should authors publish (by URI) resources with names containing non-ASCII (for example national) characters? Considering all the various parties (HTML code, browser sending request, browser saving file do disk, server receiving and processing request and server storing the file) all (possibly) using various encodings it seems nearly impossible to have it working consistently. Or at least I never managed. When it comes to web pages I’m already used to that and always replace national

National characters in URI

戏子无情 提交于 2020-01-24 16:15:21
问题 How should authors publish (by URI) resources with names containing non-ASCII (for example national) characters? Considering all the various parties (HTML code, browser sending request, browser saving file do disk, server receiving and processing request and server storing the file) all (possibly) using various encodings it seems nearly impossible to have it working consistently. Or at least I never managed. When it comes to web pages I’m already used to that and always replace national

Encoding curly braces in Jersey Client 2

ぃ、小莉子 提交于 2020-01-23 07:55:11
问题 We are using Jersey Client 2.21. I am noticing that when we put curly braces (aka curly brackets) as a param value, then it does not get properly encoded. Not only that, but anything inside the curly braces does not get encoded either. This is not true for regular brackets or other unsafe characters that I have tested with. Please see the example below. In this example I enter three params. A control param with just spaces. One with curly braces, and one with regular brackets. public static

Apache mod_proxy url encoding

若如初见. 提交于 2020-01-22 09:41:54
问题 I have a REST service that accepts parameters in a form /{parameter} Also there is Apache2 that forwards requests to the websevice <VirtualHost *:9091> AllowEncodedSlashes NoDecode LogLevel debug ProxyPass /webservice balancer://api/webservice <Proxy balancer://api> BalancerMember http://localhost:8030 </Proxy> </VirtualHost> Parameters may contain encoded characters, like %2f (/) The problem is that Apache encodes these characters again, and Webservice receives %252F instead of %2F [Mon Oct

Apache mod_proxy url encoding

爱⌒轻易说出口 提交于 2020-01-22 09:39:29
问题 I have a REST service that accepts parameters in a form /{parameter} Also there is Apache2 that forwards requests to the websevice <VirtualHost *:9091> AllowEncodedSlashes NoDecode LogLevel debug ProxyPass /webservice balancer://api/webservice <Proxy balancer://api> BalancerMember http://localhost:8030 </Proxy> </VirtualHost> Parameters may contain encoded characters, like %2f (/) The problem is that Apache encodes these characters again, and Webservice receives %252F instead of %2F [Mon Oct

Url Encoding of dictionary with AFNetworking in Objective-c

南笙酒味 提交于 2020-01-16 18:19:32
问题 i have to send POST request in following format to the server: Content Type: application/x-www-form-urlencoded Form Key : data Form Value : [ { "email" : "test@test.com", "password" : "test@test.com" } ] When i send request by this format in web rest client (Postman/Advance Rest Client),i got success in response. So how can i send this type of response with AFNetworking ? My code for Objective-c is NSDictionary *dictLogin = @{@"email":@"test@test.com",@"password":@"test@test.com"};

How to convert entites of JSP request arguments for html form textarea?

北战南征 提交于 2020-01-16 07:06:29
问题 I am new to JSP and generating a form with a text area. Is there a library to convert the text from/to an HTML's FORM TEXTAREA that will convert to/from entities for the URL to be properly formatted/parsed? For example: textarea (named ta): simple test with ampersand & in textarea url: http://.../myapp.jsp?ta=simple+test+with+ampersand+%26+in+textarea 回答1: If you are using scriptlets, you can use the URLEncoder.encode(String string, String encoding) to encode Strings in safely for use in URLs

Which parts of a URL need to be encoded?

旧时模样 提交于 2020-01-16 06:09:26
问题 With POST is easy and automatic: just use application/x-www-form-urlencoded or multipart/form-data or whatever. Instead, what parts should be encoded in a GET request? The whole query string? Just the parameter values but not the names ? And the fragment ? Maybe also the path ? But am pretty sure that I shouldn't encode the host or the scheme (since there are encoding and specs for international domains, like in japanese etc.). Hence the question is more about the URI 😉 Strangely I didn't

I get a 403 error when submitting “http://www.” via GET. Even if it's encoded beforehand. Is there a solution for this?

╄→尐↘猪︶ㄣ 提交于 2020-01-16 04:53:07
问题 It seems like my shared host provider is detecting the presence of "http://www" or "http%3A%2F%2Fwww" in any get request and serving up a 403 page. I also get an 'in addition' error... "Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." This only happens with this string. If I change it to something else the get is successfully submitted and the target page successfully returned. If it helps I'm writing a QR code getter, so the

How to prevent Scrapy from URL encoding request URLs

让人想犯罪 __ 提交于 2020-01-13 08:44:11
问题 I would like Scrapy to not URL encode my Requests. I see that scrapy.http.Request is importing scrapy.utils.url which imports w3lib.url which contains the variable _ALWAYS_SAFE_BYTES. I just need to add a set of characters to _ALWAYS_SAFE_BYTES but I am not sure how to do that from within my spider class. scrapy.http.Request relevant line: fp.update(canonicalize_url(request.url)) canonicalize_url is from scrapy.utils.url, relevant line in scrapy.utils.url: path = safe_url_string(_unquotepath