I'm sending query to documentDB by:
client = new DocumentClient(END_POINT,
MASTER_KEY, ConnectionPolicy.GetDefault(),
ConsistencyLevel.Session);
FeedResponse<Document> documents = client.queryDocuments("/dbs/mydb/colls/mycoll", query, null);
And then when i try to read response from server
for (Document document : documents.getQueryIterable())
I'm getting following exception:
{"code":"Unauthorized","message":"The input authorization token can't serve the request. Please check that the expected payload is built as per the protocol, and check the key being used. Server used the following payload to sign: 'post\ndocs\ndbs/mydb/colls/mycoll\nsun, 12 mar 2017 08:40:40 gmt\n\n'\r\nActivityId: f40f31cf-f11c-4052-94b4-992cfdd271f5"}
request headers:
"x-ms-date" -> "Sun, 12 Mar 2017 08:40:40 GMT"
"x-ms-documentdb-isquery" -> "true"
"Accept" -> "application/json"
"Content-Type" -> "application/query+json"
"authorization" -> "type%3Dmaster%26ver%3D1.0%26sig%3DiQvTEAbWWK8pvHvr9RAqp2kjiechyPp6S5kvxT4g6Kw%3D%0A"
Other request values that my be important:
resourceid = mycoll
Path = /dbs/mydb/colls/mycoll/docs/
resourceType = Document
IsMedia = false
Please help me I have no idea what can i do to fix this error