title: spring 4.1.1, mockmvc and do not want url encoding of HTTP GET request
body: <p>Using MockMVC in tests and I need to test a GET URL that is already URL encoded:</p>
  
  <pre><code>http://host:port/app/controller/[ALREADY URL ENCODED]
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>mockmvc.perform(get("/controller/[ALREADY URL ENCODED]")
  </code></pre>
  
  <p>However in the logs  I see that the URL has been url encoded again before it gets to the appropriate controller method. Is there a way that we can prevent spring mockmvc to url encode? Perhaps disable url encoding in the test?</p>
  
  <p>Real example of the "[ALREADY URL ENCODED]" string:</p>
  
  <pre><code>MEUwQzBBMD8wPTAJBgUrDgMCGgUABBQ%2Fm36Fj2BE19VBYXRO62zrgIYp0gQVAQazEyvlq22wsMBkRyAeaUiZ%2BhTUAgMGJbQ%3D
  </code></pre>
  
  <p>This gets URL encoded again before the controller sees it.</p>
  
  <p>This is from the logs (the string has been url encoded again)</p>
  
  <pre><code>xxxxx [main] DEBUG [o.s.t.w.s.TestDispatcherServlet]  DispatcherServlet with name '' processing GET request for [/app/controller/MEUwQzBBMD8wPTAJBgUrDgMCGgUABBQ%252Fm36Fj2BE19VBYXRO62zrgIYp0gQVAQazEyvlq22wsMBkRyAeaUiZ%252BhTUAgMGJbQ%253D]
  </code></pre>
  
  <p>Note that if I invoke using CURL then there is no url encoding performed by the spring framework and the controller gets what is sent across. However mockmvc would do the encoding before it gets to the appropriate controller method.</p>
  
  <pre><code>curl -X GET http:host:port/app/controller/[ALREADY URL ENCODED]
  </code></pre>
  
  <p>Thanks.</p>