title: TypeError: request() got an unexpected keyword argument 'json' - PYTHON,AWS
body: <p>Is there anyone here who can help me with this python script.</p>
  
  <p>When I execute this script I am getting this error:</p>
  
  <p><strong>TypeError: request() got an unexpected keyword argument 'json'</strong></p>
  
  <pre><code>import boto3
  import requests
  from requests_aws4auth import AWS4Auth
  
  host = 'XXXXX' # include https:// and trailing /
  region = 'ap-northeast-1'
  service = 'es'
  credentials = boto3.Session().get_credentials()
  awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, region, service, session_token=credentials.token)
  
  # Register repository
  
  headers = {"Content-Type": "application/json"}
  path = '_snapshot/XXXXX' # the Elasticsearch API endpoint
  url = host + path
  
  payload = {
    "type": "s3",
    "settings": {
      "bucket": "XXXXX",
      "region": "ap-northeast-1",
      "role_arn": "XXXXX"
    }
  }
  
  
  
  r = requests.put(url, auth=awsauth, json=payload, headers=headers)
  
  print(r.status_code)
  print(r.text)
  </code></pre>