Skip to content

Commit

Permalink
add fetchp example with post data
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed Aug 20, 2022
1 parent da7ee35 commit 4e1425e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/variables/fetchp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ Resolves the response from the url using a POST request. Similar to :doc:`$(fetc
To avoid hitting any rate limits against remote APIs, all responses are cached for 5 seconds.

Usage:
$(fetchp ``<url>`` ``[data]``)
$(fetchp ``<url>`` ``[data]`` ``[path]``)

Arguments:
* ``url`` **<required>** - The url to send the request to
* ``data`` **[optional]** - The data string to send to the url
* ``path`` **[optional]** - The path to the property in the response (JSON only)

Example Command:
**name**: !kanye
**name**: !dadjoke

**response**: $(fetchp https://api.kanye.rest/?format=text) - Kanye
**response**: $(fetchp https://icanhazdadjoke.com/graphql query=$(urlencode query { joke {id joke permalink } }) data.joke.joke)

**output**::

user: !kanye
botisimo: I'm a creative genius - Kanye
user: !dadjoke
botisimo: Why are skeletons so calm? Because nothing gets under their skin.

0 comments on commit 4e1425e

Please sign in to comment.