Answer the question
In order to leave comments, you need to log in
How to send a JSON HTTP request from Python?
Good day, toasters. You need to upload contacts to Outlook using Python tools. I found the necessary information on the Microsoft website . But I don’t quite understand how to send this HTTP request through Python. Thank you for your help.
Answer the question
In order to leave comments, you need to log in
The easiest and most convenient way is - https://github.com/kennethreitz/requests
Example code:
import requests
contacts_data = {
"givenName": "Pavel",
"surname": "Bansky",
"emailAddresses": [
{
"address": "[email protected]",
"name": "Pavel Bansky"
}
],
"businessPhones": [
"+1 732 555 0102"
]
}
r = requests.post('https://graph.microsoft.com/v1.0/me/contacts', json=contacts_data)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question