Skip to content

Commit

Permalink
format documentation for http status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mamantoha committed Mar 14, 2018
1 parent 0bb5052 commit 354ad2e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
30 changes: 10 additions & 20 deletions src/crest/exceptions.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ require "./response"

module Crest
# Hash of HTTP status code => message.
#
# * 1xx: Informational - Request received, continuing process
# * 2xx: Success - The action was successfully received, understood, and
# accepted
# * 3xx: Redirection - Further action must be taken in order to complete the
# request
# * 4xx: Client Error - The request contains bad syntax or cannot be fulfilled
# * 5xx: Server Error - The server failed to fulfill an apparently valid
# request
#
# See http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
STATUSES = {100 => "Continue",
101 => "Switching Protocols",
102 => "Processing", # WebDAV
Expand Down Expand Up @@ -91,16 +80,17 @@ module Crest
#
# Hash of HTTP status `code => message`.
#
# `1xx`: Informational - Request received, continuing process
# `2xx`: Success - The action was successfully received, understood, and
# accepted
# `3xx`: Redirection - Further action must be taken in order to complete the
# request
# `4xx`: Client Error - The request contains bad syntax or cannot be fulfilled
# `5xx`: Server Error - The server failed to fulfill an apparently valid
# request
# * **1xx**: Informational - Request received, continuing process
# * **2xx**: Success - The action was successfully received, understood, and
# accepted
# * **3xx**: Redirection - Further action must be taken in order to complete the
# request
# * **4xx**: Client Error - The request contains bad syntax or cannot be fulfilled
# * **5xx**: Server Error - The server failed to fulfill an apparently valid
# request
#
# See http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
# See [HTTP Status Code Registry](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
# for more Information.
class RequestFailed < Exception
getter response

Expand Down
18 changes: 9 additions & 9 deletions src/crest/request.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ module Crest
# * `url`
#
# Optional parameters:
# * `:headers` a hash containing the request headers
# * `:cookies` a hash containing the request cookies
# * `:payload` a hash containing query params or a raw string
# * `:params` a hash that represent query-string separated from the preceding part by a question mark (?)
# * `headers` a hash containing the request headers
# * `cookies` a hash containing the request cookies
# * `payload` a hash containing query params or a raw string
# * `params` a hash that represent query-string separated from the preceding part by a question mark (?)
# a sequence of attribute–value pairs separated by a delimiter (&).
# * `:user` and `:password` for basic auth
# * `:p_addr`, `:p_port`, `:p_user`, `:p_pass` for proxy
# * `:max_redirects` maximum number of redirections (default to `10`)
# * `:logging` enable logging (default to `false`)
# * `:logger` set logger (default to `Crest::CommonLogger`)
# * `user` and `password` for basic auth
# * `p_addr`, `p_port`, `p_user`, `p_pass` for proxy
# * `max_redirects` maximum number of redirections (default to `10`)
# * `logging` enable logging (default to `false`)
# * `logger` set logger (default to `Crest::CommonLogger`)
class Request
@method : String
@url : String
Expand Down

0 comments on commit 354ad2e

Please sign in to comment.