HttpTaskHandler payload is empty

12 views
Skip to first unread message

Rajesh G

unread,
Mar 30, 2022, 1:32:31 PM3/30/22
to google-a...@googlegroups.com
Hi, I am following
https://github.com/googleapis/nodejs-tasks/tree/main/samples

I have deployed the above to a remote server.

server.js - I am using /log_payload to test as both an appengineTaskHandler and HttpTaskHandler

If I am using it as an AppengineTaskHandler from createTask.js - It is all fine.

If I am using  'xyz.appspot.com/log_payload' as a url in HttpTaskHandler example - createHttpTask.js, then the payload is coming as empty.

--
Support Team
Field Service Software on Google Cloud Platform and Mobile


rwabukumba

unread,
Mar 31, 2022, 11:43:28 AM3/31/22
to Google App Engine
Hi, 

Looking at this post with a similar symptom, it appears that the root cause could be a missing HTTP header for the content-type, which should be set to either "application/octet-stream" or "application/json" depending on the type of content you are passing in your request. 

Based on the above, I suggest adding the header for content-type if it's currently missing then trying again. A code sample can be seen in our documentation and was also provided in this user's comment.

Reply all
Reply to author
Forward
0 new messages