| r11 vs r12 | ||
|---|---|---|
| ... | ... | |
| 35 | 35 | * 이곳의 token에는 편집 시작에서 JSON으로 받은 token값을 입력하면 된다. |
| 36 | 36 | {{{#!syntax python |
| 37 | 37 | import requests |
| 38 | import json | |
| 38 | 39 | |
| 39 | 40 | headers = { |
| 40 | 41 | 'Content-Type': 'application/json', |
| 41 | 42 | 'Authorization': 'Bearer API_TOKEN', |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | data = | |
| 45 | data = { | |
| 46 | 'text': 'Hello, world', | |
| 47 | 'log': 'api_test', | |
| 48 | 'token': received_token | |
| 49 | } | |
| 45 | 50 | |
| 46 | response = requests.post('https://theseed.io/api/edit/%EB%8D%94%EC%83%88%EB%93%9C%EC%9C%84%ED%82%A4', headers=headers, data=data) | |
| 51 | response = requests.post('https://theseed.io/api/edit/%EB%8D%94%EC%83%88%EB%93%9C%EC%9C%84%ED%82%A4', headers=headers, data=json.dumps(data)) | |
| 47 | 52 | }}} |
| 48 | 53 | ===== 결과 ===== |
| 49 | 54 | {{{#!syntax json |
| ... | ... |