You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ricky <up...@yahoo.com> on 2013/10/11 06:09:00 UTC

URL as path parameter in CXF

Hi

I want to send a request to a rest api with path param as url, something
like

http://my.api.com/http://www.nabble.com

I am encoding the url, http://www.nabble.com but I get 400 bad request.

What's the right way to send url as path parameter?

Thank you



--
View this message in context: http://cxf.547215.n5.nabble.com/URL-as-path-parameter-in-CXF-tp5734960.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: URL as path parameter in CXF

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

Possibly error is thrown by web container, because of encoded slash property is switched off by default.
In tomcat you can switch on it through org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true (see http://stackoverflow.com/questions/7955556/url-as-path-parameter-in-restful-api-causes-bad-request )

What is your use case for URI parameter? Perhaps it fit to standard HTTP header like Location or Referer.

Regards,
Andrei.

> -----Original Message-----
> From: ricky [mailto:upk_0000@yahoo.com]
> Sent: Freitag, 11. Oktober 2013 06:09
> To: users@cxf.apache.org
> Subject: URL as path parameter in CXF
> 
> Hi
> 
> I want to send a request to a rest api with path param as url, something like
> 
> http://my.api.com/http://www.nabble.com
> 
> I am encoding the url, http://www.nabble.com but I get 400 bad request.
> 
> What's the right way to send url as path parameter?
> 
> Thank you
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/URL-as-
> path-parameter-in-CXF-tp5734960.html
> Sent from the cxf-user mailing list archive at Nabble.com.