SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Список вопросов ПечатьМетки: api json json-rpc python
| RemiZOffAlex Создано: 2022-12-05 04:01:48.095865 Обновлено: 2022-12-05 04:01:48.095878 |
|---|
import requests
import json
def main():
url = "https://specialistoff.net/api"
headers = {'content-type': 'application/json'}
# Example echo method
payload = {
"method": "questions",
"params": {"page":1},
"jsonrpc": "2.0",
"id": 0,
}
response = requests.post(
url, data=json.dumps(payload), headers=headers).json()
print( response["result"] )
if __name__ == "__main__":
main()
|