src/prologue/core/httpcore/httplogue

Source   Edit  

Types

ResponseHeaders = object
  
Source   Edit  

Procs

func `$`(headers: ResponseHeaders): string {.inline, ...raises: [], tags: [],
    forbids: [].}
Source   Edit  
func `[]`(headers: ResponseHeaders; key: string): seq[string] {.inline,
    ...raises: [KeyError], tags: [], forbids: [].}

Returns the values associated with the given key. If there are no values associated with the key, an exception is raised.

To access multiple values of a key, use the overloaded [] below or to get all of them access the table field directly.

Source   Edit  
func `[]`(headers: ResponseHeaders; key: string; i: int): string {.inline,
    ...raises: [KeyError], tags: [], forbids: [].}
Returns the i'th value associated with the given key. If there are no values associated with the key or the i'th value doesn't exist, an exception is raised. Source   Edit  
func `[]=`(headers: var ResponseHeaders; key, value: string) {.inline,
    ...raises: [], tags: [], forbids: [].}
Sets the header entries associated with key to the specified value. Replaces any existing values. Source   Edit  
func `[]=`(headers: var ResponseHeaders; key: string; value: seq[string]) {.
    inline, ...raises: [], tags: [], forbids: [].}

Sets the header entries associated with key to the specified list of values. Replaces any existing values.

If value is an empty sequence, the key will be removed from headers.

Source   Edit  
func add(headers: var ResponseHeaders; key, value: string) {.inline,
    ...raises: [KeyError], tags: [], forbids: [].}
Adds the specified value to the specified key. Appends to any existing values associated with the key. Source   Edit  
proc clear(headers: ResponseHeaders) {.inline, ...raises: [], tags: [], forbids: [].}
Source   Edit  
func del(headers: var ResponseHeaders; key: string) {.inline, ...raises: [],
    tags: [], forbids: [].}
Delete the header entries associated with key Source   Edit  
func getOrDefault(headers: ResponseHeaders; key: string; default = @[""]): seq[
    string] {.inline, ...raises: [KeyError], tags: [], forbids: [].}
Returns the values associated with the given key. If there are no values associated with the key, then default is returned. Source   Edit  
func getTables(headers: ResponseHeaders): TableRef[string, seq[string]] {.
    inline, ...raises: [], tags: [], forbids: [].}
Only for internal use, don't use it! Source   Edit  
func hasKey(headers: ResponseHeaders; key: string): bool {.inline, ...raises: [],
    tags: [], forbids: [].}
Source   Edit  
func initResponseHeaders(): ResponseHeaders {.inline, ...raises: [], tags: [],
    forbids: [].}
Returns a new ResponseHeaders object. Source   Edit  
func initResponseHeaders(keyValuePairs: openArray[
    tuple[key: string, val: string]]): ResponseHeaders {....raises: [KeyError],
    tags: [], forbids: [].}
Returns a new ResponseHeaders object from an array. Source   Edit  
func len(headers: ResponseHeaders): int {.inline, ...raises: [], tags: [],
    forbids: [].}
Source   Edit  

Iterators

iterator pairs(headers: ResponseHeaders): tuple[key, value: string] {.
    ...raises: [], tags: [], forbids: [].}
Yields each key, value pair. Source   Edit