Skip to content

Commit

Permalink
Merge pull request #8 from dnnrly/feature/tables
Browse files Browse the repository at this point in the history
Fix method table formatting
  • Loading branch information
dnnrly authored Jan 16, 2020
2 parents 09945cd + d8767d8 commit bb57e44
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 55 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export PATH := $(BASE_DIR)/bin:$(PATH)

.PHONY: install deps clean clean-deps test-deps build-deps deps test acceptance-test ci-test lint release update

install: deps
install:
$(GO_BIN) install -v ./cmd/$(NAME)

build:
$(GO_BIN) build -v ./cmd/$(NAME)
Expand Down
116 changes: 62 additions & 54 deletions methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/MEthods`,
Name: "GET",
Summary: "The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.",
Description: `The HTTP GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
Request has body No
Successful response has body Yes
Safe Yes
Idempotent Yes
Cacheable Yes
Allowed in HTML forms Yes
Request has body No
Successful response has body Yes
Safe Yes
Idempotent Yes
Cacheable Yes
Allowed in HTML forms Yes
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET`,
},
Expand All @@ -30,12 +31,13 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET`,
A response to a HEAD method should not have a body. If so, it must be ignored. Even so, entity headers describing the content of the body, like Content-Length may be included in the response. They don't relate to the body of the HEAD response, which should be empty, but to the body of similar request using the GET method would have returned as a response.
If the result of a HEAD request shows that a cached resource after a GET request is now outdated, the cache is invalidated, even if no GET request has been made.
Request has body No
Successful response has body No
Safe Yes
Idempotent Yes
Cacheable Yes
Allowed in HTML forms No
Request has body No
Successful response has body No
Safe Yes
Idempotent Yes
Cacheable Yes
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD`,
},
Expand All @@ -60,12 +62,12 @@ When the POST request is sent via a method other than an HTML form — like via
Providing a block of data, such as the result of submitting a form, to a data-handling process;
Extending a database through an append operation.
Request has body Yes
Successful response has body Yes
Safe No
Idempotent No
Cacheable Only if freshness information is included
Allowed in HTML forms Yes
Request has body Yes
Successful response has body Yes
Safe No
Idempotent No
Cacheable Only if freshness information is included
Allowed in HTML forms Yes
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST`,
},
Expand All @@ -75,25 +77,27 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST`,
Description: `The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.
The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side effect), where successive identical POST may have additional effects, like passing an order several times.
Request has body Yes
Successful response has body No
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No
Request has body Yes
Successful response has body No
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT`,
},
{
Name: "DELETE",
Summary: "The DELETE method deletes the specified resource.",
Description: `The HTTP DELETE request method deletes the specified resource.
Request has body May
Successful response has body May
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No
Request has body May
Successful response has body May
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE`,
},
Expand All @@ -105,25 +109,27 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE`,
For example, the CONNECT method can be used to access websites that use SSL (HTTPS). The client asks an HTTP Proxy server to tunnel the TCP connection to the desired destination. The server then proceeds to make the connection on behalf of the client. Once the connection has been established by the server, the Proxy server continues to proxy the TCP stream to and from the client.
CONNECT is a hop-by-hop method.
Request has body No
Successful response has body Yes
Safe No
Idempotent No
Cacheable No
Allowed in HTML forms No
Request has body No
Successful response has body Yes
Safe No
Idempotent No
Cacheable No
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT`,
},
{
Name: "OPTIONS",
Summary: "The OPTIONS method is used to describe the communication options for the target resource.",
Description: `The HTTP OPTIONS method is used to describe the communication options for the target resource. The client can specify a URL for the OPTIONS method, or an asterisk (*) to refer to the entire server.
Request has body No
Successful response has body Yes
Safe Yes
Idempotent Yes
Cacheable No
Allowed in HTML forms No
Request has body No
Successful response has body Yes
Safe Yes
Idempotent Yes
Cacheable No
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS`,
},
Expand All @@ -133,12 +139,13 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS`,
Description: `The HTTP TRACE method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism.
The final recipient of the request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (OK) response with a Content-Type of message/http. The final recipient is either the origin server or the first server to receive a Max-Forwards value of 0 in the request.
Request has body No
Successful response has body No
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No
Request has body No
Successful response has body No
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/TRACE`,
},
Expand All @@ -154,12 +161,13 @@ PATCH (like PUT) may have side-effects on other resources.
To find out whether a server supports PATCH, a server can advertise its support by adding it to the list in the Allow or Access-Control-Allow-Methods (for CORS) response headers.
Another (implicit) indication that PATCH is allowed, is the presence of the Accept-Patch header, which specifies the patch document formats accepted by the server.
Request has body Yes
Successful response has body Yes
Safe No
Idempotent No
Cacheable No
Allowed in HTML forms No
Request has body Yes
Successful response has body Yes
Safe No
Idempotent No
Cacheable No
Allowed in HTML forms No
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH`,
},
Expand Down

0 comments on commit bb57e44

Please sign in to comment.