Internal Interfaces

Parser Interface

HTTP.Parsers.parse_status_line!Function

Parse HTTP response-line bytes and set the status and version fields of response. Return a SubString containing the header-field lines.

source
HTTP.Parsers.parse_request_line!Function

Parse HTTP request-line bytes and set the method, target and version fields of request. Return a SubString containing the header-field lines.

source

Messages Interface

HTTP.Messages.headerFunction
header(::Message, key [, default=""]) -> String

Get header value for key (case-insensitive).

source
HTTP.Messages.hasheaderFunction
hasheader(::Message, key) -> Bool

Does header value for key exist (case-insensitive)?

source
hasheader(::Message, key, value) -> Bool

Does header for key match value (both case-insensitive)?

source
HTTP.Messages.readheadersFunction
readheaders(::IO, ::Message)

Read headers (and startline) from an IO stream into a Message struct. Throw EOFError if input is incomplete.

source
HTTP.MessageRequest.setuseragent!Function
setuseragent!(x::Union{String, Nothing})

Set the default User-Agent string to be used in each HTTP request. Can be manually overridden by passing an explicit User-Agent header. Setting nothing will prevent the default User-Agent header from being passed.

source
HTTP.Messages.writeheadersFunction
writeheaders(::IO, ::Message)

Write Message start line and a line for each "name: value" pair and a trailing blank line.

source
Base.writeMethod
write(::IO, ::Message)

Write start line, headers and body of HTTP Message.

source

IOExtras Interface

HTTP.IOExtrasModule
IOExtras

This module defines extensions to the Base.IO interface to support:

  • startwrite, closewrite, startread and closeread for streams with transactional semantics.
source
Missing docstring.

Missing docstring for HTTP.IOExtras.startwrite(::IO). Check Documenter's build log for details.

Streams Interface

HTTP.Streams.isabortedFunction
isaborted(::Stream{Response})

Has the server signaled that it does not wish to receive the message body?

"If [the response] indicates the server does not wish to receive the message body and is closing the connection, the client SHOULD immediately cease transmitting the body and close the connection." RFC7230, 6.5

source

Connection Pooling Interface

HTTP.ConnectionPool.ConnectionType
Connection{T <: IO}

A TCPSocket or SSLContext connection to a HTTP host and port.

Fields:

  • host::String
  • port::String, exactly as specified in the URI (i.e. may be empty).
  • pipeline_limit, number of requests to send before waiting for responses.
  • idle_timeout, No. of seconds to maintain connection after last transaction.
  • peerip, remote IP adress (used for debug/log messages).
  • peerport, remote TCP port number (used for debug/log messages).
  • localport, local TCP port number (used for debug messages).
  • io::T, the TCPSocket or `SSLContext.
  • clientconnection::Bool, whether the Connection was created from client code (as opposed to server code)
  • buffer::IOBuffer, left over bytes read from the connection after the end of a response header (or chunksize). These bytes are usually part of the response body.
  • sequence, number of most recent Transaction.
  • writecount, number of Messages that have been written, protected by writelock
  • writelock, lock writecount and writebusy, and signal that writecount was incremented.
  • writebusy, whether a Transaction currently holds the Connection write lock, protected by writelock
  • readcount, number of Messages that have been read, protected by readlock
  • readlock, lock readcount and readbusy, and signal that readcount was incremented.
  • readbusy, whether a Transaction currently holds the Connection read lock, protectecd by readlock
  • timestamp, time data was last received.
source
HTTP.ConnectionPool.TransactionType
Transaction

A single pipelined HTTP Request/Response transaction.

Fields:

  • c, the shared Connection used for this Transaction.
  • sequence::Int, identifies this Transaction among the others that share c.
  • writebusy::Bool, whether this Transaction holds its parent Connection write lock, protected by c.writelock
  • readbusy::Bool, whether this Transaction holds its parent Connection read lock, protected by c.readlock
source
HTTP.IOExtras.closereadMethod
closeread(::Transaction)

Signal that an entire Response Message has been read from the Transaction.

Increment readcount and wake up tasks waiting in startread.

source