google apps marketplace - Gmail Gadget Error 406 being thrown on osapi.http.post -


we have multiple marketplace apps use gmail contextual gadgets. these have been running years successfully.

we noticing following intermittent error being thrown when calling out external web server using open social osapi.http.post

"{"id":"http.post","error":{"message":"response not valid json","code":406}}"

we have checked , there nothing wrong our server. can make call directly our server without fail.

we can replicate issue calling multiple servers running different apps/gadgets. commonality appears use of osapi.http.post.

here post

          osapi.http.post({               'body': postdata,               'href': serverurl + 'ilinkstreamer.ashx?data=' + "" + settimestamp() + debugstring,               'format': 'json',               'authz': 'signed',               'nocache': true             }).execute(displaystreamlist);  

which raises 406 error above

has else noticed issue?? not sure how can address it?

i had same issue while , found problem. invoking external resources using osapi.http.post. read new documentation , found there new way same.

check this url more details, idea you'll need use makerequest api, this:

var params = {};     params[gadgets.io.requestparameters.content_type] = gadgets.io.contenttype.json; params[gadgets.io.requestparameters.authorization] = gadgets.io.authorizationtype.signed; params[gadgets.io.requestparameters.method] = gadgets.io.methodtype.post; gadgets.io.makerequest("https://your.backend.com", on_response_function, params); ... def on_response_function(response){ ... } 

i hope helps someone. i'm not sure if i'm one, never received notification message previous api deprecated. :(


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -