HTTP (Requests)¶
Interact with HTTP endpoints and APIs. Perform operations such as GET, POST and more.
Installation¶
Importing the Plugin¶
After you installed this package, the next step is to import the package into your code and start using the functions.
Performing a Request¶
GET¶
POST¶
# Instantiate the plugin
url = "https://ptsv2.com/t/ocrc3-1624379671/post"
http = BotHttpPlugin(url)
# Sets the parameters for a POST request
params = {
'id': 'ocrc3-1624379671',
'text': 'POST Example'
}
http.set_params(params)
# Perform a POST request with parameters
print(http.post().text)
Tip
Alternativelly you can use the post_as_json
method.