# std.http.Client: remove bad decisions from fetch\(\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/743a0c966de933e3d0a271f942c2db525df5dbe8)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 743a0c966de933e3d0a271f942c2db525df5dbe8

Requested commit: 743a0c966de933e3d0a271f942c2db525df5dbe8

Commit: 743a0c966de933e3d0a271f942c2db525df5dbe8

Tree: 4b5e037f933ca37963a68f68b4dd05a517d8dbca

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.http.Client: remove bad decisions from fetch()

* "storage" is a better name than "strategy".
* The most flexible memory-based storage API is appending to an
  ArrayList.
* HTTP method should default to POST if there is a payload.
* Avoid storing unnecessary data in the FetchResult
* Avoid the need for a deinit() method in the FetchResult

The decisions that this logic made about how to handle files is beyond
repair:
- fail to use sendfile() on a plain connection
- redundant stat
- does not handle arbitrary streams
So, file-based response storage is no longer supported. Users should use
the lower-level open() API which allows avoiding these pitfalls.

```

## Parents

- [0ddcb8341822cf9e3fd555c29a9e011b9a91d9fc](https://git.cafe/gitcafe/zig/commit/0ddcb8341822cf9e3fd555c29a9e011b9a91d9fc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/743a0c966de933e3d0a271f942c2db525df5dbe8?format=markdown)
