Google API calling through postman - google-cloud-platform

Google API calling through postman.
Get url https://logging.googleapis.com/v2/projects/projectid/logs/
Error:
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"id\": Cannot bind query parameter. Field 'id' could not be found in request message.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON payload received. Unknown name \"id\": Cannot bind query parameter. Field 'id' could not be found in request message."
}
]
}
]
}
}

Related

AWs API Gateway Mapping Template Invalid

I'm starting a Journey with API Templates, and this is my actual question, but it's answered with "Don't use mapping templates, put logic in client or lambda".
Before even getting that far I'm tried the mapping template from the AWS Blog for Using Amazon API Gateway as a proxy for DynamoDB
In the integration response I paste the text from the blog:
#set($inputRoot = $input.path('$'))
{
"comments": [
#foreach($elem in $inputRoot.Items) {
"commentId": "$elem.commentId.S",
"userName": "$elem.userName.S",
"message": "$elem.message.S"
}#if($foreach.hasNext),#end
#end
]
}
Validation fails with
Validation Result: warnings : [], errors : [Invalid content type specified: #set($inputRoot = $input.path('$')) { "comments": [ #foreach($elem in $inputRoot.Items) { "commentId": "$elem.commentId.S", "userName": "$elem.userName.S", "message": "$elem.message.S" }#if($foreach.hasNext),#end #end ] }]
I tried the answer from this question get the same error.
This was operator error. it was in the error message [Invalid content type specified: I was trying to the conde into the field for content/type.

Postman post image data to strapi

I'm able to post data "title" and "sequence" using POST in postman.
However, how should I post the image? What about multiple images as well?
I've tried using
1)Body with form-data, img as key and place a file in it, however the img is still null. Response:
{
"title": "test title 2",
"sequence": 5,
"_id": "5bd1658f39702a5df8a1e447",
"createdAt": "2018-10-25T06:41:19.197Z",
"updatedAt": "2018-10-25T06:41:19.358Z",
"__v": 0,
"img": null,
"id": "5bd1658f39702a5df8a1e447"
}
2) Convert the image to base 64 string and post it as json:
Request:
{
"title": "test title 3",
"sequence": 6
"img": "base64stringxxxxx"
}
Response:
{
"message": "An internal server error occurred",
"statusCode": 500,
"error": "Internal Server Error"
}

Django data handling in custom middleware

In my django webapp, I have to pass user data param(udp) in a request and return the same in response without modifying it in view.
Request
{
"mobile": "111111111",
"udp":[
{
"key": "keyName",
"value":"valueName"
},
{
"key": "keyName",
"value":"valueName"
},
]
}
Response
{
"code": "200",
"message": "success message",
"response": {
"data":"user data"
"udp":[
{
"key": "keyName",
"value":"valueName"
},
{
"key": "keyName",
"value":"valueName"
}
]
}
}
I thought of acheiving this by writting custom middleware but after accessing request in middleware, View is throwing me error
you cannot access body after reading from request's data stream
Can anyone suggest how this can be implemented?
or
What will be best approach of doing this in django

Cannot "Query" hyperledger-fabric, error code -32003

I have a working Hyperledger-Fabric environment, running locally on my Mac. I setup the chaincode_example02 code, but the Query REST call isn't working. I trying doing a deploy and invoke and both of those calls work. I am using Postman to send the REST calls.
Query:
{
"jsonrpc": "2.0",
"method": "query",
"params": {
"type": 1,
"chaincodeID": {
"name": "mycc",
"path": "/tmp/hyperledger-BR/example0/gopath/src/github.com/chaincode_example02/chaincode_example02"
},
"ctorMsg": {
"function": "query",
"args": ["b"]
}
},
"id": 0
}
Serverside Error:
Error starting Simple chaincode: Error handling message:
[ef980ad7-94c8-4ec9-92f4-3ebdd47e4321]Chaincode handler FSM cannot
handle message (RANGE_QUERY_STATE) with payload size (10) while in
state: ready
Postman Returned Error:
{ "jsonrpc": "2.0", "error": {
"code": -32003,
"message": "Query failure",
"data": "Error when querying chaincode: Error:Failed to execute transaction or query(Timeout expired while executing transaction)"
}, "id": 0 }
I have been digging online, but I have no idea why this is happening. Any clue as to why this is happening?

Handling error from server in ember

When i try to handling the response from server, I cant able to read the error status and detail (i.e., those fields are empty)
Below i show my response what i am getting,
{
"message": "Ember Data Request POST http://192.168.1.21:8888/api/test returned a 0?Payload (Empty Content-Type)?",
"name": "Error",
"errors":
[
{
"detail": "",
"status": "0",
"title": "The backend responded with an error",
}
],
"description":undefined,
"fileName":undefined
}
Why this fields are empty? what should i do to overcome this?