Class HttpRequestSnippet

java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.http.HttpRequestSnippet
All Implemented Interfaces:
Snippet

public class HttpRequestSnippet extends TemplatedSnippet
A Snippet that documents an HTTP request.
Author:
Andy Wilkinson
See Also:
  • Constructor Details

    • HttpRequestSnippet

      protected HttpRequestSnippet()
      Creates a new HttpRequestSnippet with no additional attributes.
    • HttpRequestSnippet

      protected HttpRequestSnippet(Map<String,Object> attributes)
      Creates a new HttpRequestSnippet with the given additional attributes that will be included in the model during template rendering.
      Parameters:
      attributes - the additional attributes
  • Method Details

    • createModel

      protected Map<String,Object> createModel(Operation operation)
      Description copied from class: TemplatedSnippet
      Create the model that should be used during template rendering to document the given operation. Any additional attributes that were supplied when this TemplatedSnippet were created will be automatically added to the model prior to rendering.
      Specified by:
      createModel in class TemplatedSnippet
      Parameters:
      operation - the operation
      Returns:
      the model