Skip to content

Missing brackets from example Python request code snippets #21

@dotpeedeeeff

Description

@dotpeedeeeff

Existing code

`import requests
headers = {
'Accept': 'application/json'
}

r = requests.get('https://api.carbonintensity.org.uk/intensity', params={}, headers = headers)

print r.json()
`

The copied phone snippet from the docs did not work on python3.10, adding the brackets around r.json() got it working fine.

`import requests
headers = {
'Accept': 'application/json'
}

r = requests.get('https://api.carbonintensity.org.uk/intensity', params={}, headers = headers)

print(r.json())
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions