Ejemplo n.º 1
0
 /**
  * Adds the description of the {@code Content-Type} header to a link.
  *
  * @param link the link where the description of the header will be added
  */
 private void addContentTypeHeader(DetailedLink link) {
   Headers headers = link.getRequest().getHeaders();
   if (headers == null) {
     headers = new Headers();
     link.getRequest().setHeaders(headers);
   }
   Header header = new Header();
   header.setName("Content-Type");
   header.setValue("application/xml|json");
   header.setRequired(true);
   headers.getHeaders().add(header);
 }
Ejemplo n.º 2
0
 /**
  * Adds the description of the {@code Expect} header to a link.
  *
  * @param link the link where the description of the header will be added
  * @param value the value of the header
  */
 private void addExpectHeader(DetailedLink link, String value) {
   Headers headers = link.getRequest().getHeaders();
   if (headers == null) {
     headers = new Headers();
     link.getRequest().setHeaders(headers);
   }
   Header header = new Header();
   header.setName("Expect");
   header.setValue(value);
   header.setRequired(false);
   headers.getHeaders().add(header);
 }
Ejemplo n.º 3
0
 /**
  * Adds the description of the {@code Correlation-Id} header to a link.
  *
  * @param link the link where the description of the header will be added
  */
 private void addCorrelationIdHeader(DetailedLink link) {
   Headers headers = link.getRequest().getHeaders();
   if (headers == null) {
     headers = new Headers();
     link.getRequest().setHeaders(headers);
   }
   Header header = new Header();
   header.setName("Correlation-Id");
   header.setValue("any string");
   header.setRequired(false);
   headers.getHeaders().add(header);
 }