Class HttpDocumentation
java.lang.Object
org.springframework.restdocs.http.HttpDocumentation
Static factory methods for documenting a RESTful API's HTTP requests.
- Author:
- Andy Wilkinson, Jonathan Pearlin
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpRequestSnippet
Returns a newSnippet
that will document the HTTP request for the API operation.static HttpRequestSnippet
httpRequest
(Map<String, Object> attributes) Returns a newSnippet
that will document the HTTP request for the API operation.static HttpResponseSnippet
Returns aSnippet
that will document the HTTP response for the API operation.static HttpResponseSnippet
httpResponse
(Map<String, Object> attributes) Returns aSnippet
that will document the HTTP response for the API operation.
-
Method Details
-
httpRequest
Returns a newSnippet
that will document the HTTP request for the API operation.- Returns:
- the snippet that will document the HTTP request
-
httpRequest
Returns a newSnippet
that will document the HTTP request for the API operation. The givenattributes
will be available during snippet generation.- Parameters:
attributes
- the attributes- Returns:
- the snippet that will document the HTTP request
-
httpResponse
Returns aSnippet
that will document the HTTP response for the API operation.- Returns:
- the snippet that will document the HTTP response
-
httpResponse
Returns aSnippet
that will document the HTTP response for the API operation. The givenattributes
will be available during snippet generation.- Parameters:
attributes
- the attributes- Returns:
- the snippet that will document the HTTP response
-