Repository: PyGithub/PyGithub

Issue:
GithubIntegrations get_access_token: TypeError: request() got an unexpected keyword argument 'body'
hey everyone!

I am trying to use GithubIntegration and get the access token:

```
gi.get_access_token(
    installation_id=app_installations[0]['id']
)
```

but it is raising this error:

```
...
/mnt/sda1/storage/miniconda/envs/openteam/lib/python3.6/site-packages/requests/api.py in request(method='post', url='https://api.github.com/installations/<app_install_id>/access_tokens', **kwargs={'body': None, 'data': None, 'headers': {'Accept': 'application/vnd.github.machine-man-preview+json', 'Authorization': 'Bearer <jwt>', 'User-Agent': 'PyGithub/Python'}, 'json': None})
     58     # cases, and look like a memory leak in others.
     59     with sessions.Session() as session:
---> 60         return session.request(method=method, url=url, **kwargs)
        session.request = <bound method Session.request of <requests.sessions.Session object at 0x7fcf4f6b3080>>
        method = 'post'
        url = 'https://api.github.com/installations/<app_install_id>/access_tokens'
        kwargs = {'data': None, 'json': None, 'headers': {'Authorization': 'Bearer <jwt>', 'Accept': 'application/vnd.github.machine-man-preview+json', 'User-Agent': 'PyGithub/Python'}, 'body': None}
     61 
     62 

TypeError: request() got an unexpected keyword argument 'body'
```

** <app_install_id> and <jwt> original was replaced here

using `requests` lib directly works fine.

any thoughts?

---

PKG INFO:

PyGithub                  1.43.4                    < pip >
requests                  2.21.0                py36_1000    conda-forge


Discussion:
Maybe it's a typo. `requests.post` should accept `json` or `data` as keyword argument instead of `body`.

For more detail, please see [requests/api.py#L108](https://github.com/requests/requests/blob/v2.21.0/requests/api.py#L108)

Resolving patch:
diff --git a/github/MainClass.py b/github/MainClass.py
--- a/github/MainClass.py
+++ b/github/MainClass.py
@@ -772,16 +772,18 @@ def get_access_token(self, installation_id, user_id=None):
         :param installation_id: int
         :return: :class:`github.InstallationAuthorization.InstallationAuthorization`
         """
-        body = None
+        body = {}
         if user_id:
-            body = json.dumps({"user_id": user_id})
-        response = requests.post("https://api.github.com/installations/{}/access_tokens".format(installation_id),
-                                 headers={
-                                     "Authorization": "Bearer {}".format(self.create_jwt()),
-                                     "Accept": Consts.mediaTypeIntegrationPreview,
-                                     "User-Agent": "PyGithub/Python"
-                                 },
-                                 body=body)
+            body = {"user_id": user_id}
+        response = requests.post(
+            "https://api.github.com/installations/{}/access_tokens".format(installation_id),
+            headers={
+                "Authorization": "Bearer {}".format(self.create_jwt()),
+                "Accept": Consts.mediaTypeIntegrationPreview,
+                "User-Agent": "PyGithub/Python"
+            },
+            json=body
+        )
         response_text = response.text
 
         if atLeastPython3:


Test patch: