{"size": 1199, "ext": "scrbl", "max_stars_repo_path": "request/private/base.scrbl", "max_stars_repo_name": "yurkobb/racket-request", "max_stars_repo_stars_event_min_datetime": "2015-09-10T00:32:04.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-25T21:00:17.000Z", "max_issues_repo_path": "request/private/base.scrbl", "max_issues_repo_name": "yurkobb/racket-request", "max_issues_repo_issues_event_min_datetime": "2015-07-20T19:57:43.000Z", "max_issues_repo_issues_event_max_datetime": "2020-05-30T06:21:09.000Z", "max_forks_repo_path": "request/private/base.scrbl", "max_forks_repo_name": "yurkobb/racket-request", "max_forks_repo_forks_event_min_datetime": "2015-07-13T06:34:05.000Z", "max_forks_repo_forks_event_max_datetime": "2019-06-07T15:01:08.000Z"}
{"max_stars_count": 21, "max_issues_count": 19, "max_forks_count": 6, "avg_line_length": 37.46875, "max_line_length": 67, "alphanum_fraction": 0.6547122602}
#lang scribble/manual

@(require "../doc-utils/examples.rkt"
          "../doc-utils/def.rkt"
          (for-label request
                     racket))

@title{HTTP Requests and Requester}

@defrequester[http-requester]{
  A simple requester for the HTTP protocol built with
  @racket[get-impure-port], @racket[put-impure-port],
  @racket[post-impure-port], and @racket[delete-impure-port].
  Locations are @racket[url?]s, headers are @racket[string?]s
  as in the impure port functions, bodies are @racket[bytes?],
  and responses are instances of the @racket[http-response] struct.
}

@defstruct*[http-response ([code exact-positive-integer?]
                           [headers (hash/c string? string?
                                            #:immutable? #t)]
                           [body string?])]{
  A structure type for HTTP responses. Contains a status
  code, a hash of headers, and a raw body string.
  @racket[http-requester] responds with instances of
  this structure type. This is distinct from the
  @racket[response] structure type in the web server
  package, as that response is for @italic{sending}
  responses while this struct is used when
  @italic{receiving} them.
}
