Hi, I code in python and I’m a beginner. I want to know how to use an API but I’m not sure how to send in requests, what is the easiest way to send them? Is it possible to put them as an html file?
These are the examples I got from the API documentation, I have no idea where I’m supposed to enter them and how to combine them with python:
#!/bin/bash
clientId=“my_client_id”
secret=“my_secret”
curl -H “AuthClientId: ${clientId}” -H “AuthSecret: ${secret}”
“https://…”
#!/bin/env powershell
$clientId = ‘my_client_id’
$secret = ‘my_secret’
$url = “https…”
$headers = @{
“AuthClientId” = $clientId;
“AuthSecret” = $secret;
}
try {
$result = Invoke-RestMethod -Uri $url -Headers $headers -Method GET
Write-Output $result
}
catch {
$errorvalue = $_.Exception.Response.StatusCode.Value__
Write-Output “Got Error $errorvalue”
}