问题
Good morning i'm trying to integrate with google+ domains api using HTTP Requests to the service but i'm facing some problems.
i'm using oauth 2.0 to authenticate my connection and my get and delete requests work fine but the post and put requests always reply bad request.
i've pointed the request to my computer and change to http to catch him here is the catch for a add person to circle put request.
PUT /plus/v1domains/circles/16934bff8fa1939apeople?email=fakeuser%40example.com HTTP/1.1
Authorization: Bearer ya29.xnxnxnxnxnxnxnxnxnxnxxn-nxnxnxnxnx
X-JavaScript-User-Agent: Google APIs Explorer
Host: 192.168.21.143
Content-Length: 1
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
i'm using the bearer on the heather but not the api key in the url request because it was the only way of get's and deletes work. Without the API key the get and delete requests works properly but the put and post requests returns the following response:
BadRequest"
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
],
"code": 400,
"message": "Invalid Value"
}
}
回答1:
Your request is malformed and missing a slash. It should be:
PUT /plus/v1domains/circles/16934bff8fa1939a/people?email=fakeuser%40example.com HTTP/1.1
来源:https://stackoverflow.com/questions/18724326/google-plus-domains-api-http-request-add-people-fails