Hi Sebastian, I have tried a number of cases for the header specifications while sending the query to Contenthub, but I could not read the Location header with jQuery at all, even any other headers. However, the details of the response seems like as follows through the Live HTTP Headers plugin in Firefox:
HTTP/1.1 201 Created Access-Control-Allow-Origin: * Location: http://localhost:8080/contenthub/contenthub/store/content/urn:content-item-sha1-358dbe75624b135aa72c1ad6cc34f325bf7fdf50 Content-Length: 0 Server: Jetty(6.1.x) Then, I ran across the following note in [1]: "The Cross-Origin Resource Sharing specification filters the headers that are exposed by |getAllResponseHeaders() <http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-getallresponseheaders>| for non same-origin <http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#same-origin> requests." I think this may be the reason. I'm not sure though. [1] http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-getallresponseheaders Best, Suat On 05/15/2012 07:19 PM, Sebastian Germesin wrote: > Dear all, > > we are currently working on extending the VIE.StanbolService and currently > face a problem with the content hub of Apache Stanbol. > > From the REST API, it seems that a simple HTTP-POST request is enough to > create a resource and in fact it works and the result is a HTTP response (201 > - Created). > > However, using jQuery, we are currently not able to retrieve the location of > the created resource, to be more precise, the "Location" header field is not > readable from jQuery. > > I've created a jsbin example for you to test the code: > > http://jsbin.com/unekoh/edit#javascript,html,live > > Could you please be so kind to have a look at it and check why jQuery is not > able to parse the header? > > Is it maybe possible to also send the location as response text? > > > Thanks a lot in advance, > > Sebastian
