Auth0 API Request

ぐ巨炮叔叔 提交于 2019-12-13 07:49:38

问题


I'm trying to make a patch request to my auth0 API endpoint, myaccount.auth0.com/api/v2/users/:id. I've set the headers to be application/json, but I still get the following error:

_body: "{"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}"

The request I made looks like this:

headers.append('Content-Type', 'application/json');
var data: any = {
    "app_metadata": {
        "ward": "99999"
    }
};

return this._http.patch('https://pjlamb12.auth0.com/api/v2/users/auth0|571844c894efdc0a5b6a4144', data, {headers: headers}).map(res => res.json());

I matched the data I'm sending to the docs like it shows here.

Why would I be getting this error when posting a JSON object like the docs show? What could I be missing?

来源:https://stackoverflow.com/questions/36784721/auth0-api-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!