[12:45:01] 🤨 do I need to care about this “extra bitmap file” on gitlab? : https://tools-static.wmflabs.org/bridgebot/21f6a6c7/file_49656.jpg [12:46:33] !log tools.lexeme-forms deployed c9e84dfb8d (add separators to Dutch nouns) [12:46:36] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.lexeme-forms/SAL [13:00:49] !log tools.lexeme-forms deployed 4e2653cf19 (revert recent punjabi-noun-masculine-guru change) [13:00:52] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.lexeme-forms/SAL [15:26:02] I have a rest.php question. I'm trying to make requests to it with the Python requests library, and I consistently get back this `415` error message telling me that (empty string) is an invalid Content-Type, even though I am pretty sure I am passing either `application/json` or `application/json-patch+json` as the Content-Type. Am I somehow doing this wrong? [16:07:41] share your code please? [17:09:32] https://dpaste.org/2r9Ta (re @wmtelegram_bot: share your code please?) [17:09:42] I'm specifically having trouble with PATCH [17:10:08] The part where I differentiate between application/json and application/json-patch+json is commented out at the moment but I previously had it uncommented [17:15:39] hmm, I'd be very surprised if requests did not set the correct Content-Type automatically. have you tried not setting it explicitely at all? [17:15:51] have you tried having it send the requests to a server you control so you could check the body is correct? [17:29:42] You don't seem to actually pass the content type to the _request function? (re @harej: https://dpaste.org/2r9Ta) [17:30:30] The content type is derived from the verb that is passed [17:30:45] headers = { 'content-type': 'application/json' } works for me [17:30:53] lowercase content-type not uppercase? [17:33:07] url = 'https://www.wikidata.org/w/rest.php/wikibase/v0/entities/items/Q5/statements' [17:33:08] headers = {} [17:33:09] print(page.json()) [17:33:11] headers = { 'Content-type': 'application/json' } [17:33:12] page = requests.post(url, headers = headers) [17:33:14] print(page.json()) [17:34:03] Sure but that's a get request, I don't think I ever had a problem with that [17:34:21] post != get [17:36:45] Okay but it's patch I'm having trouble with [17:39:49] I did, same outcome (re @wmtelegram_bot: hmm, I'd be very surprised if requests did not set the correct Content-Type automatically. have you tried not setting it...) [17:46:45] you could do any of: make requests log what's happening , connect to a server you control and log it server side, or make a reduced test case with some other client that will log verbosely e.g. curl CLI [17:58:09] I should do those things. I wanted to make sure first I wasn't missing something obvious. [17:58:18] Thank you, everyone