http-requests

Put request

Send HTTP Put request to the URL of your choosing, pass URL parameters and data body as string or JSON, set timeout, authenticate with many different auth options, display the response, even pretty print the JSON response.

httprequestsput

Required packages

You need below packages to use the code generated by recipe. All packages are automatically installed in MLJAR Studio.

requests>=2.32.3

python-dotenv>=1.0.1

Interactive recipe

You can use below interactive recipe to generate code. This recipe is available in MLJAR Studio.

Python code

# Python code will be here

Code explanation

  1. If chosen set request parameters to the params variable with option to load a secret value.
  2. If chosen set request body data with option to set json as body.
  3. If chosen set authentication secrets in request headers.
  4. Send requeset.
  5. If timeout time exeeded, fail the request.
  6. If the response status code is from 4XX or 5XX range, raise the exception.
  7. If chosen show the response body, with option to pretty print the JSON response.

Http requests cookbook

Code recipes from Http requests cookbook.

« Previous
Get request