You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_content/body.md
+13-19Lines changed: 13 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,8 +217,6 @@ To use a custom auth scheme with Requester you define the auth class in your env
217
217
218
218
Requester comes with a few pre-written auth "plugins" you can use in your code, or as a reference. Run __Requester: Authentication Options__ in the command palette to see the list. Have a look at __Token__ auth, which simplifies passing a token in the __"Authorization"__ header of your requests.
219
219
220
-
>Handling complicated auth protocols, like OAuth1 and OAuth2, might require Python packages not bundled with Requester. This section explains how to [extend Requester to import any package](#import-any-python-package-with-requester).
221
-
222
220
223
221
### Forms and File Uploads
224
222
Requests makes posting forms and uploading files easy. See how in the Requests documentation.
If you pass the file as a `chunked` upload, the __"Transfer-Encoding": "chunked"__ header is added to your request. Some servers don't allow chunked uploads, in which case you can use a `streamed` upload. If they're an option, chunked uploads are nicer: they come with a progress bar and can be cancelled.
238
236
239
-
>If you need streaming uploads for multipart forms, or uploads of multiple files, the `requests-toolbelt`packages has your back. Check out [this section](#import-any-python-package-with-requester).
237
+
>If you need streaming uploads for multipart forms, or uploads of multiple files, the `requests-toolbelt`package has your back. Check out [this section](#import-any-python-package-with-requester).
240
238
241
239
242
240
### Downloads
@@ -423,31 +421,17 @@ Requester provides autocomplete/autosuggest and linting for GraphQL queries, lik
423
421
424
422
Requester lints your query and displays syntax errors with their line and column numbers. More detailed debug information is printed to the Sublime Text console. Try it on one of the requests above.
425
423
426
-
Autocomplete depends on [graphql-py](https://github.com/ivelum/graphql-py/), a package you can install as an extension to Requester. See [this section](#import-any-python-package-with-requester) for more details.
427
-
428
424
>If autocomplete doesn't work, it's probably being overridden by another autocomplete package, like __All Autocomplete__, __tern_for_sublime__, etc. Remove these packages, or disable them for Requester response views if possible.
429
425
430
426
>GraphQL autocomplete will never override autocompletions provided by your other packages.
431
427
432
428
433
429
## Import Any Python Package with Requester
434
-
Requester comes bundled with various packages (`requests`, `jsonschema`, `requests-oauthlib`, `requests-toolbelt`, `graphql-py`) but you can trivially extend it to import __any__ Python 3 package in its env. All you have to do is set Requester's `packages_path` setting to a directory with Python 3 packages. Requester can then import these packages in your env block or env file. ✨✨
430
+
Requester comes bundled with a few packages (`requests`, `requests-oauthlib`, `requests-toolbelt`) that you can import in an env block or env file, but you can trivially extend it to import __any__ Python 3 package in its env. All you have to do is set Requester's `packages_path` setting to a directory with Python 3 packages. Requester can then import these packages in your env block or env file. ✨✨
435
431
436
432
In my settings for Requester `packages_path` points to a Python 3 virtual env: `/Users/kylebebak/.virtualenvs/general/lib/python3.5/site-packages`. I use `pip` to install these packages.
437
433
438
434
439
-
### Pip3 Quickstart
440
-
If you don't have `virtualenv` or you're not comfortable using it, the quick solution is to install Python 3, which will install `pip3` and `python3` executables. Run `which pip3` to make sure you've done this.
441
-
442
-
Then run `pip3 install requests-oauthlib`, `pip3 install requests-toolbelt`, `pip3 install graphql-py`, and so on for whatever packages you'd like to use with Requester.
443
-
444
-
Finally, run `pip3 show requests-oauthlib`, and look for the __LOCATION__ field in the output. Now you know where pip is installing your packages.
445
-
446
-
Use this path as your `packages_path` setting in Requester's settings file. To open these settings, look for __Requester: Settings__ in the command palette.
447
-
448
-
>Note: Sublime Text runs Python 3.3, and there are some packages, such as `browsercookie`, that can only be imported by Sublime Text if they are downloaded with `pip3.3`. The best way to download Python 3.3 is with [pyenv](https://gist.github.com/Bouke/11261620), but this can be a bit of pain. My advice: don't bother unless you really want to use one of these packages.
449
-
450
-
451
435
### OAuth1 and OAuth2
452
436
__requests-oauthlib__ makes OAuth1 and OAuth2 a lot easier. Let's say you want explore the Twitter REST API, which uses OAuth1 for authentication. Go to <https://apps.twitter.com/app/new>, create a new application, then go to the __Keys and Access Tokens__ tab for your application. Generate an access token and an access token secret, grab your API key and secret, and pass them to `OAuth1`.
Python has auth libraries for authenticating with a wide variety of APIs. With `pip` and the `packages_path` setting Requester can access them all.
468
+
469
+
### Pip3 Quickstart
470
+
If you don't have `virtualenv` or you're not comfortable using it, the quick solution is to install Python 3, which will install `pip3` and `python3` executables. Run `which pip3` to make sure you've done this.
471
+
472
+
Then run `pip3 install <package>`, and so on for whatever packages you'd like to use with Requester.
473
+
474
+
Finally, run `pip3 show <package>`, and look for the __LOCATION__ field in the output. Now you know where pip is installing your packages.
475
+
476
+
Use this path as your `packages_path` setting in Requester's settings file. To open these settings, look for __Requester: Settings__ in the command palette.
477
+
478
+
>Note: Sublime Text runs Python 3.3, and there are some packages, such as `browsercookie`, that can only be imported by Sublime Text if they are downloaded with `pip3.3`. The best way to download Python 3.3 is with [pyenv](https://gist.github.com/Bouke/11261620), but this can be a bit of pain. My advice: don't bother unless you really want to use one of these packages.
0 commit comments