close

[Solved] Attribute: ‘set’ object has no attribute ‘items’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Attribute: ‘set’ object has no attribute ‘items’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Attribute: ‘set’ object has no attribute ‘items’ Error Occurs?

Today I get the following error Attribute: ‘set’ object has no attribute ‘items’ in python.

How To Solve Attribute: ‘set’ object has no attribute ‘items’ Error ?

  1. How To Solve Attribute: 'set' object has no attribute 'items' Error ?

    To Solve Attribute: 'set' object has no attribute 'items' Error You forget to commas in "token GITHUBTOKEN"

  2. Attribute: 'set' object has no attribute 'items'

    To Solve Attribute: 'set' object has no attribute 'items' Error You forget to commas in "token GITHUBTOKEN"

Solution 1

Try:

gethooks = "https://api.github.com/repos/ORGANIZATION/REPO/hooks"
response = requests.get(gethooks, headers={'Authorization': 'token GITHUBTOKEN'})
print(response)

You’re supposed to use a dictionary for headers.

Solution 2

You forget to commas in "token GITHUBTOKEN"

import requests
gethooks= "https://api.github.com/repos/ORGANIZATION/REPO/hooks"
headers={"Authorization": "token GITHUBTOKEN"}
response = requests.get(gethook, headers=headers)
print(response)

you should try it. It will give you result

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read