cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <>
Subject Build Location header in HTTP 201 response
Date Fri, 07 Feb 2014 13:52:49 GMT

I'm using Apache CXF 2.7.3 and JAX-RS API to build a REST webservice

I've seen that the best response to return from a REST webservice when
an entity is created is a 201 HTTP code and set Location HTTP header
with the resource URI

My webservice is installed behind Apache HTTPD server as reverse proxy
Sometimes my webservice is invoked from internet as

and sometimes is invoked from a private network  as


How I can set Location header correctly ? I mean,
if requests come from intranet , to return Location:
and request from private network , to return

How I can do this ?

Other choice is to return a 200 HTTP code with some payload, but I
don't know if it's forbidden according REST rules

Thanks and regards

View raw message