Steps to replicate the issue (include links if applicable):
- Make a request to Pageviews_top_by_country with a project with any special character
- code below :
import requests prod_url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/top-by-country/en.wikipedia.org^/all-access/2020/01' header = {"accept": "application/json", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"} response = requests.get(prod_url, headers=header) print(response.status_code) print(response.json())
What happens?:
status code 404 is returned
What should have happened instead?:
status code 400 is returned as seen in PROD
Software version (skip for WMF-hosted wikis like Wikipedia):
pageviews_top_by_country endpoint