Page MenuHomePhabricator

[REST API] unable to set accept-language for /page/summary/ endpoint
Closed, InvalidPublic


I'm having trouble with the /page/summary/{title} endpoint of the REST API at /api/rest_v1

Long story short, I'm trying to request specific language variants from wikipedias that could serve different dialects to the same url (ex: can render in raw Serbian, or in latinized Serbian sr_el, and can render Simplified Chinese zh_CN or Traditional Chinese zh_TW)

However, even though there is ostensibly an Accept-Language header param in the API that should be the way to set it, (based on past discussion in T122942), using it doesn't seem to actually do anything.

For example, even with the example provided in docs at!/Page_content/get_page_summary_title, running Accept-Language sr-el still gives back the raw Serbian:

Screen Shot 2018-12-20 at 2.09.33 PM.png (433×862 px, 73 KB)

Same story if I call the API myself instead of through the UI in the docs:

(basically, I only ever get the extract as seen in, not

I've also tried this with "zh-tw", "tw", "zh-TW" and "zh_TW" for, but I only ever get Simplified Chinese in the response.

(compare and

What's going on here? Why isn't the Accept-Language param working?

Event Timeline

Madepossiblebyviewerslikeyou renamed this task from [REST API] unable to set accept-language to [REST API] unable to set accept-language for /page/summary/ endpoint.Dec 20 2018, 10:18 PM

Currently, Serbian is the only language where variants are supported. All the rest of the languages are on their way (Chineese)

I've just tried your example for Serbian both via the doc UI and via curl - both work as expected for me. Please reopen if you are still experiencing the issue.