1 Reply Latest reply on Apr 15, 2013 8:44 AM by Milan Milas

    Restlet - how to set Locaton header (OData requires this)

    Milan Milas Newbie

      Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class);

      response.setStatus(Status.SUCCESS_NO_CONTENT);

      response.setLocationRef("http://localhost:8887/IVRInterface/CreateShiftRequestTypes(0)");

      exchange.getOut().setHeader(RestletConstants.RESTLET_RESPONSE, response);

      exchange.getOut().setHeader("LocationRef","http://localhost:8887/IVRInterface/CreateShiftRequestTypes(0)");

       

      I have tried to use this code as well but it does not recognise Header.class:

       

       

      ConcurrentMap)

              attrs.putIfAbsent(HeaderConstants.ATTRIBUTE_HEADERS, headers);

          if (prev != null) { headers = prev; }

      }

      headers.add("location", "myHeaderValue");