-1

sorry if the question seems to be meaningless, i just want to make sure is there a way or any solution for this. Any Help is appreciated

 request({url:url, search:qs}, function(e,r,body) {
   qs:{ name: 'Rome||Turin||venice||milan'}
})

is their a way to set encoding false, so that exact name: Rome||Turin||venice||milan goes to the server

browser will encode it add something like %7fc% or any other characters

terik_poe
  • 523
  • 4
  • 17
  • 1
    No. This is a URI which has specifications for what characters are allowed and how the disallowed characters should be encoded. The browser chooses to follow those specifications (fortunately for us all). Servers should properly decode query strings before using them. The server can easily be fixed to do the proper thing on its end. – jfriend00 Jan 15 '17 at 07:35
  • so that means, browser will encode the required characters, and itself decode it and provide the server URL with decoded string, Or the server will receive the encoded characters and server itself decodes it? – terik_poe Jan 15 '17 at 07:44
  • Browser sends legal, encoded URI to the server. Server decodes URI before using it. – jfriend00 Jan 15 '17 at 07:48
  • Terik that's the perfect question broh, you have to clear your doubts. Thanks for providing the perfect answer @jfriend00 – parwatcodes Jan 15 '17 at 08:00

1 Answers1

0

No, you cannot turn URI encoding off in the browser and you should not turn URI encoding off in any other type of client either. There is a URI specification that specifies what characters are allowed in a URI. All clients should encode their URIs to ensure that the URI they send to the server follows the specification.

Upon receipt of a request all servers should decode the URI before using it.

Fortunately for us all, browsers follow this specification and encode URIs before sending them to the server. Any server expecting to work properly will decode incoming URIs to get back the intended text.

jfriend00
  • 683,504
  • 96
  • 985
  • 979