arseniyandru arseniyandru - 28 days ago 9
HTTP Question

CXF Url Encoding on a client side

How to disable url encoding on a client side using CXF
For example

restClient.sendRequest("myemail@ololo.com")


Will be converted to

Address: http://myhost.com/endpoint?email=myemail%40ololo.com
Http-Method: DELETE
Content-Type: application/xml
Headers: {Content-Type=[application/xml], Accept=[application/xml]}


How can I configure my client to disable that?

Answer

For any URL you can find, certain characters are special and must be escaped before forming the URI (See RFC 2396)

reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                "$" | ","

It means you have to send the @ character as %40 in the URL.

If you want to send @ unescaped do not use a Query parameter. Use a POST request with the desired content in the body of the payload and a text content-type such as text/plain or application/xml (do not use application/x-www-form-urlencoded)

Comments