From 8d41ea5bfd53508160ee852bcb2f6676efa22b0a Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 1 Jul 2019 18:43:00 +0200 Subject: [PATCH] Use POST in Client.fetchImageUrl Reduces the amount of different request methods we're using. Not really sure whether this is actually the best option: - Each request includes `fb_dtsg` and such, so using POST everywhere might be the more secure option? - But at the same time, the request is more opaque, and harder to debug (urllib3 logs all request urls automatically, so using GET would make that easy) --- fbchat/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fbchat/_client.py b/fbchat/_client.py index f38ffa8..c2582a5 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -944,8 +944,8 @@ class Client(object): """ image_id = str(image_id) data = {"photo_id": str(image_id)} - j = self._get( - "/mercury/attachments/photo/", query=data, fix_request=True, as_json=True + j = self._post( + "/mercury/attachments/photo/", data, fix_request=True, as_json=True ) url = get_jsmods_require(j, 3)