package http

  1. Overview
  2. Docs
type informational = [
  1. | `Continue
    (*

    Client should continue with request

    *)
  2. | `Switching_protocols
    (*

    Server is switching protocols

    *)
  3. | `Processing
    (*

    Server has received and is processing the request

    *)
  4. | `Checkpoint
    (*

    resume aborted PUT or POST requests

    *)
]

Informational

type success = [
  1. | `OK
    (*

    standard response for successful HTTP requests

    *)
  2. | `Created
    (*

    request has been fulfilled; new resource created

    *)
  3. | `Accepted
    (*

    request accepted, processing pending

    *)
  4. | `Non_authoritative_information
    (*

    request processed, information may be from another source

    *)
  5. | `No_content
    (*

    request processed, no content returned

    *)
  6. | `Reset_content
    (*

    request processed, no content returned, reset document view

    *)
  7. | `Partial_content
    (*

    partial resource return due to request header

    *)
  8. | `Multi_status
    (*

    XML, can contain multiple separate responses

    *)
  9. | `Already_reported
    (*

    results previously returned

    *)
  10. | `Im_used
    (*

    request fulfilled, response is instance-manipulations

    *)
]

Success

type redirection = [
  1. | `Multiple_choices
    (*

    multiple options for the resource delivered

    *)
  2. | `Moved_permanently
    (*

    this and all future requests directed to the given URI

    *)
  3. | `Found
    (*

    temporary response to request found via alternative URI

    *)
  4. | `See_other
    (*

    permanent response to request found via alternative URI

    *)
  5. | `Not_modified
    (*

    resource has not been modified since last requested

    *)
  6. | `Use_proxy
    (*

    content located elsewhere, retrieve from there

    *)
  7. | `Switch_proxy
    (*

    subsequent requests should use the specified proxy

    *)
  8. | `Temporary_redirect
    (*

    connect again to different URI as provided

    *)
  9. | `Permanent_redirect
    (*

    connect again to a different URI using the same method

    *)
]

Redirection

type client_error = [
  1. | `Bad_request
    (*

    request cannot be fulfilled due to bad syntax

    *)
  2. | `Unauthorized
    (*

    authentication is possible but has failed

    *)
  3. | `Payment_required
    (*

    payment required, reserved for future use

    *)
  4. | `Forbidden
    (*

    server refuses to respond to request

    *)
  5. | `Not_found
    (*

    requested resource could not be found

    *)
  6. | `Method_not_allowed
    (*

    request method not supported by that resource

    *)
  7. | `Not_acceptable
    (*

    content not acceptable according to the Accept headers

    *)
  8. | `Proxy_authentication_required
    (*

    client must first authenticate itself with the proxy

    *)
  9. | `Request_timeout
    (*

    server timed out waiting for the request

    *)
  10. | `Conflict
    (*

    request could not be processed because of conflict

    *)
  11. | `Gone
    (*

    resource is no longer available and will not be available again

    *)
  12. | `Length_required
    (*

    request did not specify the length of its content

    *)
  13. | `Precondition_failed
    (*

    server does not meet request preconditions

    *)
  14. | `Request_entity_too_large
    (*

    request is larger than the server is willing or able to process

    *)
  15. | `Request_uri_too_long
    (*

    URI provided was too long for the server to process

    *)
  16. | `Unsupported_media_type
    (*

    server does not support media type

    *)
  17. | `Requested_range_not_satisfiable
    (*

    client has asked for unprovidable portion of the file

    *)
  18. | `Expectation_failed
    (*

    server cannot meet requirements of Expect request-header field

    *)
  19. | `I_m_a_teapot
    (*

    I'm a teapot

    *)
  20. | `Enhance_your_calm
    (*

    Twitter rate limiting

    *)
  21. | `Unprocessable_entity
    (*

    request unable to be followed due to semantic errors

    *)
  22. | `Locked
    (*

    resource that is being accessed is locked

    *)
  23. | `Failed_dependency
    (*

    request failed due to failure of a previous request

    *)
  24. | `Upgrade_required
    (*

    client should switch to a different protocol

    *)
  25. | `Precondition_required
    (*

    origin server requires the request to be conditional

    *)
  26. | `Too_many_requests
    (*

    user has sent too many requests in a given amount of time

    *)
  27. | `Request_header_fields_too_large
    (*

    server is unwilling to process the request

    *)
  28. | `No_response
    (*

    server returns no information and closes the connection

    *)
  29. | `Retry_with
    (*

    request should be retried after performing action

    *)
  30. | `Blocked_by_windows_parental_controls
    (*

    Windows Parental Controls blocking access to webpage

    *)
  31. | `Wrong_exchange_server
    (*

    the server cannot reach the client's mailbox

    *)
  32. | `Client_closed_request
    (*

    connection closed by client while HTTP server is processing

    *)
]

Client_error

type server_error = [
  1. | `Internal_server_error
    (*

    generic error message

    *)
  2. | `Not_implemented
    (*

    server does not recognise method or lacks ability to fulfill

    *)
  3. | `Bad_gateway
    (*

    server received an invalid response from upstream server

    *)
  4. | `Service_unavailable
    (*

    server is currently unavailable

    *)
  5. | `Gateway_timeout
    (*

    gateway did not receive response from upstream server

    *)
  6. | `Http_version_not_supported
    (*

    server does not support the HTTP protocol version

    *)
  7. | `Variant_also_negotiates
    (*

    content negotiation for the request results in a circular reference

    *)
  8. | `Insufficient_storage
    (*

    server is unable to store the representation

    *)
  9. | `Loop_detected
    (*

    server detected an infinite loop while processing the request

    *)
  10. | `Bandwidth_limit_exceeded
    (*

    bandwidth limit exceeded

    *)
  11. | `Not_extended
    (*

    further extensions to the request are required

    *)
  12. | `Network_authentication_required
    (*

    client needs to authenticate to gain network access

    *)
  13. | `Network_read_timeout_error
    (*

    network read timeout behind the proxy

    *)
  14. | `Network_connect_timeout_error
    (*

    network connect timeout behind the proxy

    *)
]

Server_error

type t = [
  1. | `Code of int
  2. | standard
]
val compare : t -> t -> int
val to_string : t -> string
val to_int : t -> int
val of_int : int -> t
val reason_phrase_of_code : int -> string
val pp : Stdlib.Format.formatter -> t -> unit
OCaml

Innovation. Community. Security.