Class HttpDocumentation

java.lang.Object
org.springframework.restdocs.http.HttpDocumentation

public abstract class HttpDocumentation extends Object
Static factory methods for documenting a RESTful API's HTTP requests.
Author:
Andy Wilkinson, Jonathan Pearlin
  • Method Details

    • httpRequest

      public static HttpRequestSnippet httpRequest()
      Returns a new Snippet that will document the HTTP request for the API operation.
      Returns:
      the snippet that will document the HTTP request
    • httpRequest

      public static HttpRequestSnippet httpRequest(Map<String,Object> attributes)
      Returns a new Snippet that will document the HTTP request for the API operation. The given attributes will be available during snippet generation.
      Parameters:
      attributes - the attributes
      Returns:
      the snippet that will document the HTTP request
    • httpResponse

      public static HttpResponseSnippet httpResponse()
      Returns a Snippet that will document the HTTP response for the API operation.
      Returns:
      the snippet that will document the HTTP response
    • httpResponse

      public static HttpResponseSnippet httpResponse(Map<String,Object> attributes)
      Returns a Snippet that will document the HTTP response for the API operation. The given attributes will be available during snippet generation.
      Parameters:
      attributes - the attributes
      Returns:
      the snippet that will document the HTTP response