League Table update via REST API
-
Hey everyone,
I have a problem where I can’t get any further.
I’m trying to update the league table with REST API.
I use python for that.I manage to update data like date or status but it doesn’t work to change the data of the table (data).
example that work:
import requests import json import pprint username = 'xxx' password = 'xxx' api_url = "https://www.xxx.xx/wp-json/sportspress/v2/tables/5591" headers = {'content-type': 'application/json'} data = {'status': 'publish'} response = requests.patch(api_url, auth=(username, password), json=data, headers=headers) response.json() print(response.json())
example that does not work:
import requests import json import pprint username = 'xxx' password = 'xxx' api_url = "https://www.xxx.xx/wp-json/sportspress/v2/tables/5591" headers = {'content-type': 'application/json'} data = {'data': {'574': {'p': '14'}}} response = requests.patch(api_url, auth=(username, password), json=data, headers=headers) response.json() print(response.json())
In all cases I get the status code 200 as response. I’ve also tried Postman. With the same result.
I would be happy if you could help me with this. Many thanks and best regards!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘League Table update via REST API’ is closed to new replies.