I do not know why I receive the respone: "415: Unsupported Media Type"
I try to put new values. When I get some values it works fine.
code snippet:
headers = {}
headers["charset"] = "utf-8"
headers["Accept-Language"] = "pl-PL"
headers["Content-Type"] = "application/json"
headers["Accept"] = "application/vnd.allegro.public.v1+json"
headers["Authorization"] = "Bearer {}".format(access_token)
with requests.Session() as session:
session.headers.update(headers)
DEFAULT_API_URL = "https://api.allegro.pl"
payload = {"maxAmount": {"amount": "230.00", "currency": "PLN"}}
response = session.put(
url=DEFAULT_API_URL + "/bidding/offers/1498090700/bid",
json=json.dumps(payload),
)
print(f"{response.status_code}: {response.reason}")
print(response.json())
Response: "415: Unsupported Media Type"
According to the API documentation, the content type of the request also needs to be
application/vnd.allegro.public.v1+json. Try e.g.