Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Instagram API OAutheException:“;您必须提供一个“客户id”;_Python_Api_Instagram_Python Requests_Access Token - Fatal编程技术网

Python Instagram API OAutheException:“;您必须提供一个“客户id”;

Python Instagram API OAutheException:“;您必须提供一个“客户id”;,python,api,instagram,python-requests,access-token,Python,Api,Instagram,Python Requests,Access Token,当我试图从Instagram接收访问令牌时。我执行以下请求 params = { 'client_id' : config.INSTAGRAM_APP_ID, 'client_secret' : config.INSTAGRAM_APP_SECRET_KEY, 'grant_type' : 'authorization_code', 'redirect_uri' : '`my localhost`', 'code' : code } r = req

当我试图从Instagram接收访问令牌时。我执行以下请求

params = {
    'client_id' : config.INSTAGRAM_APP_ID,
    'client_secret' : config.INSTAGRAM_APP_SECRET_KEY,
    'grant_type' : 'authorization_code',
    'redirect_uri' : '`my localhost`',
    'code' : code
    }
r = requests.post('https://api.instagram.com/oauth/access_token', params = params)
和接收错误:

{"code": 400, "error_type": "OAuthException", "error_message": "You must provide a client_id"}

我能用这些做什么?

我把这些参数放在(x-www-form-encoded)正文中,而不是放在标题中,解决了这个问题(这一想法归功于)


注意:我没有使用python包装器。

使用
app\u id
app\u secret


对于邮递员,将身体参数放入
x-www-form-urlencoded

您是否设法解决了此问题?是否有人解决了此问题请更正!对于x-www-form-urlencoded,请求也适用于邮递员