Fix typos, spelling issues, and grammar in docs (#426)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kyle Galbraith · committed by Seth Michael Larson · parent 9bbd040 · Browse files · 7 files·+23 added−24 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+23 added−24 removed
- other:+23 added−24 removed
Provenance
- Commit
b65bce5- Tree
540915c- Author
Kyle Galbraith <kyle.galbraith459@gmail.com>- Committer
Seth Michael Larson <sethmichaellarson@gmail.com>- Parent
9bbd040
7 files changed+23 added−24 removed
modified:docs/advanced.md+4 added-4 removed
40 unmodified lines4142434445454647484919 unmodified lines6970717273737475757677787976 unmodified lines15615715815916016016116240 unmodified linesassert r.status_code == 200assert r.text == "Hello World!"```
For some more complex cases you might need to customize the WSGI or ASGIFor some more complex cases, you might need to customize the WSGI or ASGIdispatch. This allows you to:
* Inspect 500 error responses, rather than raise exceptions, by setting `raise_app_exceptions=False`.* Mount the WSGI or ASGI application at a subpath, by setting `script_name` (WSGI) or `root_path` (ASGI).19 unmodified lines>>> client.send(r)<Response [200 OK]>```
## Specify the version of HTTP protocol## Specify the version of the HTTP protocol
One can set the version of HTTP protocol for the client in case you want to make the requests using specific version.One can set the version of the HTTP protocol for the client in case you want to make the requests using a specific version.
For example:
```python76 unmodified lines proxy_mode=httpx.HTTPProxyMode.TUNNEL_ONLY)client = httpx.Client(proxies=proxy)
# This request will be tunnelled instead of forwarded.# This request will be tunneled instead of forwarded.client.get("http://example.com")```modified:docs/compatibility.md+1 added-1 removed
4 unmodified lines567899101112137 unmodified lines4 unmodified linesThis documentation outlines places where the API differs...
## QuickStart
Pretty much all the API mentioned in the `requests` QuickStart should be identicalPretty much any API mentioned in the `requests` QuickStart should be identicalto the API in our own documentation. The following exceptions apply:
* `Response.url` - Returns a `URL` instance, rather than a string. Use `str(response.url)` if you need a string instance.* `httpx.codes` - In our documentation we prefer the uppercased versions, such as `codes.NOT_FOUND`,7 unmodified linesmodified:docs/contributing.md+4 added-4 removed
1 # Contributing2 3-Thank you for being interested in contributing with HTTPX.4-There are many ways you can contribute with the project:3+Thank you for being interested in contributing to HTTPX.4+There are many ways you can contribute to the project:5 6 - Try HTTPX and [report bugs/issues you find](https://github.com/encode/httpx/issues/new)7 - [Implement new features](https://github.com/encode/httpx/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)8 - [Review Pull Requests of others](https://github.com/encode/httpx/pulls)49 unmodified lines58 We use [nox](https://nox.thea.codes/en/stable/) to automate testing, linting,59 and documentation building workflow. Make sure you have it installed60 at your system before starting.61 62-Install nox with:62+Install `nox` with:63 64 ```shell65 $ python3 -m pip install --user nox66 ```4 unmodified lines71 ```shell72 $ pipx install nox73 ```74 75-Now, with nox installed run the complete pipeline with:75+Now, with nox installed, run the complete pipeline with:76 77 ```shell78 $ nox79 ```56 unmodified linesmodified:docs/index.md+1 added-1 removed
101 unmodified lines102 * `brotlipy` - Decoding for "brotli" compressed responses. *(Optional)*103 104 A huge amount of credit is due to `requests` for the API layout that105 much of this work follows, as well as to `urllib3` for plenty of design106-inspiration around the lower level networking details.106+inspiration around the lower-level networking details.107 108 ## Installation109 110 Install with pip:6 unmodified linesmodified:docs/parallel.md+4 added-5 removed
35 unmodified lines36 ```37 38 ## Exceptions and Cancellations39 40-The style of using `parallel` blocks ensures that you'll always have well41-defined exception and cancellation behaviours. Request exceptions are only ever42-raised when calling either `get_response` or `next_response`, and any pending43-requests are cancelled on exiting the block.40+The style of using `parallel` blocks ensures that you'll always have a well-defined exception and cancellation behaviors. Request exceptions are only ever41+raised when calling either `get_response` or `next_response` and any pending42+requests are canceled on exiting the block.43 44 ## Parallel requests with a Client45 46 You can also call `parallel()` from a client instance, which allows you to48-control the authentication or dispatch behaviour for all requests within the47+control the authentication or dispatch behavior for all requests within the48 block.49 50 ```python51 >>> client = httpx.Client()19 unmodified linesmodified:docs/quickstart.md+8 added-8 removed
3 unmodified lines4 This page closely follows the layout of the `requests` QuickStart documentation.5 The `httpx` library is designed to be API compatible with `requests` wherever6 possible.7 8-First start by importing HTTPX:8+First, start by importing HTTPX:9 10 ```11 >>> import httpx12 ```48 unmodified lines61 ```62 63 ## Response Content64 65-HTTPX will automatically handle decoding the response content into unicode text.65+HTTPX will automatically handle decoding the response content into Unicode text.66 67 ```python68 >>> r = httpx.get('https://www.example.org/')69 >>> r.text57 unmodified lines127 128 ## Sending Form Encoded Data129 130 Some types of HTTP requests, such as `POST` and `PUT` requests, can include data131-in the request body. One common way of including that is as form encoded data,131+in the request body. One common way of including that is as form-encoded data,132 which is used for HTML forms.133 134 ```python135 >>> data = {'key1': 'value1', 'key2': 'value2'}61 unmodified lines197 ```198 199 ## Sending JSON Encoded Data200 201-Form encoded data is okay if all you need is simple key-value data structure.201+Form encoded data is okay if all you need is a simple key-value data structure.202 For more complicated data structures you'll often want to use JSON encoding instead.203 204 ```python205 >>> data = {'integer': 123, 'boolean': True, 'list': ['a', 'b', 'c']}15 unmodified lines221 ```222 223 ## Sending Binary Request Data224 225-For other encodings you should use either a `bytes` type, or a generator225+For other encodings, you should use either a `bytes` type or a generator226 that yields `bytes`.227 228 You'll probably also want to set a custom `Content-Type` header when uploading229 binary data.60 unmodified lines290 >>> r.headers.get('content-type')291 'application/json'292 ```293 294-Multiple values for a single response header are represented as a single comma separated294+Multiple values for a single response header are represented as a single comma-separated295 value, as per [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2):296 297-> A recipient MAY combine multiple header fields with the same field name into one “field-name: field-value” pair, without changing the semantics of the message, by appending each subsequent field value to the combined field value in order, separated by a comma.297+> A recipient MAY combine multiple header fields with the same field name into one “field-name: field-value” pair, without changing the semantics of the message, by appending each subsequent field-value to the combined field value in order, separated by a comma.298 299 ## Cookies300 301 Any cookies that are set on the response can be easily accessed:26 unmodified lines328 ```329 330 ## Redirection and History331 332-By default HTTPX will follow redirects for anything except `HEAD` requests.332+By default, HTTPX will follow redirects for anything except `HEAD` requests.333 334 The `history` property of the response can be used to inspect any followed redirects.335 It contains a list of all any redirect responses that were followed, in the order336 in which they were made.68 unmodified linesmodified:README.md+1 added-1 removed
107 unmodified lines108 * `brotlipy` - Decoding for "brotli" compressed responses. *(Optional)*109 110 A huge amount of credit is due to `requests` for the API layout that111 much of this work follows, as well as to `urllib3` for plenty of design112-inspiration around the lower level networking details.112+inspiration around the lower-level networking details.113 114 <p align="center">— ⭐️ —</p>115 <p align="center"><i>HTTPX is <a href="https://github.com/encode/httpx/blob/master/LICENSE.md">BSD licensed</a> code. Designed & built in Brighton, England.</i></p>