aboutsummaryrefslogtreecommitdiff
path: root/lib/std/http/Client.zig
AgeCommit message (Collapse)Author
2023-10-21std.http.Server: improve documentation, do -> startNameless
Response.do was renamed to Response.start to mimic the naming scheme in http.Client
2023-10-21std.http.Client: improve documentationNameless
2023-10-21std.http: make encoding fields non-null, store as enum variantNameless
2023-10-21std.http.Client: make transfer-encoding priority over content-length as per specNameless
2023-10-21std.http.Client: add option to disable httpsNameless
std_options.http_connection_pool_size removed in favor of ``` client.connection_pool.resize(client.allocator, size); ``` std_options.http_disable_tls will remove all https capability from std.http when true. Any https request will error with `error.TlsInitializationFailed`. Solves #17051.
2023-10-21std.http.Client: store *Connection instead of a pool node, buffer writesNameless
2023-10-21std.http.Client: enhance proxy supportNameless
adds connectTunnel to form a HTTP CONNECT tunnel to the desired host. Primarily implemented for proxies, but like connectUnix may be called by any user. adds loadDefaultProxies to load proxy information from common environment variables (http_proxy, HTTP_PROXY, https_proxy, HTTPS_PROXY, all_proxy, ALL_PROXY). - no_proxy and NO_PROXY are currently unsupported. splits proxy into http_proxy and https_proxy, adds headers field for arbitrary headers to each proxy.
2023-10-21x86_64: fix bugs and disable erroring testsJacob Young
2023-09-28std.http: introduce options to http client to allow for raw urisEmil Lerch
Addresses #17015 by introducing a new startWithOptions. The only option is currently is a flag to use the provided URI as is, without modification when passed to the server. Normally, this is not needed nor desired. However, some REST APIs may have requirements that cannot be satisfied with the default handling.
2023-09-26std.http: add identity to content encodings (#16493)Chris Burgess
Some servers will respond with the identity encoding, meaning no encoding, especially when responding to range-get requests. Adding the identity encoding stops the header parser from failing when it encounters this.
2023-09-25std.http.Client: add note about resource managementJan Weidner
2023-08-30std.http: allow for arbitrary http methodsNameless
2023-08-29std.http: connectUnix return Unsupported on targets without unix socketsNameless
2023-08-29std.http: handle expect:100-continue and continue responsesNameless
2023-08-29std.http: add Client.fetch and improve redirect logicNameless
2023-08-27std: Rename `TailQueue` to `DoublyLinkedList`Jay Petacat
`TailQueue` was implemented as a doubly-linked list, but named after an abstract data type. This was inconsistent with `SinglyLinkedList`, which can be used to implement an abstract data type, but is still named after the implementation. Renaming `TailQueue` to `DoublyLinkedList` improves consistency between the two type names, and should help discoverability. `TailQueue` is now a deprecated alias of `DoublyLinkedList`. Related to issues #1629 and #8233.
2023-07-07std.http: fix leaked connections (#16341)Nameless
The early return in pool release was causing leaked connections. Closes #16282.
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-22http: fix getting Transfer-Encoding valuePiotr Sarna
The 'Content-Length' header was inspected by mistake, which makes it effectively impossible to use chunked Transfer-Encoding when using the http client. Tested locally with a HTTP server - data is properly sent with POST method and the proper encoding declared, after the fix.
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-17std.http: Fix segfault while redirectingMizuochi Keita
Make to avoid releasing request's connection twice. Change the `Request.connection` field optional. This field is null while the connection is released. Fixes #15965
2023-06-17zlib: naming conventionXavier Bouchoux
Adress review comments from https://github.com/ziglang/zig/pull/13977 by using the same naming convention as zstd. And by using `finish()` instead of `close()` for the finalisation of the compressed stream. rationale: - it is not the same as how close() is usually used, since it must be called to flush and write the final bytes. And as such it may fail. - it is not the same `flush` in the deflate code, which allows to keep writting more bytes later, and doesn't write the final checksum. - it is the same name as used in the original zlib library (Z_FINISH) Also, use a packed struct for the header, which seems a better fit.
2023-06-03Merge pull request #15579 from squeek502/mem-delimitersAndrew Kelley
Split `std.mem.split` and `tokenize` into `sequence`, `any`, and `scalar` versions
2023-06-01std.http.Server: collapse BufferedConnection into ConnectionNameless
2023-06-01std.http: add TlsAlert descriptions so that they can at least be viewed in ↵Nameless
err return traces
2023-06-01std.http.Client: collapse BufferedConnection into ConnectionNameless
2023-05-13Update all std.mem.split calls to their appropriate functionRyan Liptak
Everywhere that can now use `splitScalar` should get a nice little performance boost.
2023-05-13Update all std.mem.tokenize calls to their appropriate functionRyan Liptak
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
2023-05-06std.http: use larger read buffer to hit faster tls codeNameless
2023-05-06fix keepalive and large buffered writesNameless
2023-05-06std.http: buffer writesNameless
2023-05-06std.http: add simple standalone http tests, add state check for http serverNameless
2023-04-28std: update to use `@memcpy` directlyAndrew Kelley
2023-04-26std.http: do -> wait, fix redirectsNameless
2023-04-24Merge pull request #15416 from squeek502/http-response-headers-undefinedAndrew Kelley
std.http: Always initialize `response.headers` in Client.request
2023-04-23std.http: Always initialize `response.headers` in Client.requestRyan Liptak
Before this change, if a request errored before getting its `response.headers` initialized, then it would attempt to `deinit` `response.headers` which would still be `undefined`. Since all locations that set `response.headers` use the same code, it can just be done upfront in `request` instead. Closes #15380
2023-04-21move the HTTP test to lib/std/http/test.zigRyo Ota
2023-04-21fix memory leaks and add an HTTP testRyo Ota
2023-04-20fix http client build errorRyo Ota
2023-04-18std.http: pass Method to request directly, parse trailing headersNameless
2023-04-17std.http: curate some Server errors, fix reading chunked bodiesNameless
2023-04-17std.http: add HeadersNameless
2023-04-17std.http: very basic http client proxyNameless
2023-04-17std.http: further curate error set, remove last_errorNameless
2023-04-17add explicit error union for Bundle.rescan and associated functionsNameless
2023-04-17HTTP client and server send "0\r\n\r\n" when chunked encodingRyo Ota
2023-04-08std.http: add documentationNameless
2023-04-08update package manager to use req.do(), fix chunked trailer readingNameless
2023-04-08fix bugs, waitForCompleteHead -> do, move redirecting to do instead of readNameless
fix for 32bit arches curate error sets for api facing functions, expose raw errors in client.last_error fix bugged dependency loop, disable protocol tests (needs mocking) add separate mutex for bundle rescan
2023-04-08add buffering to connection instead of the http protocol, to allow passing ↵Nameless
through upgrades