-
Re: How do you set request timeout header in osapi?
pawans Nov 30, 2015 5:38 PM (in response to tahir_mirza@persistent.com)Hi,
This should work--
osapi.http.post({
authz:"signed",
href:'/random',
readTimeout:20
}).execute(function(response){
})
-
Re: How do you set request timeout header in osapi?
tahir_mirza@persistent.com Dec 6, 2015 10:54 PM (in response to pawans)Hi Pawan,
Thanks for replying. I tried setting the readTimeout parameter but it still gives the following error object in response:
- error: Object
- code: 406
- message: "Response not valid JSON"
The same code works for small attachments but fails for large attachments like 4 mb.
So is there a parameter that needs to be set at my backend service as well? And the value of readTimeout is in seconds or milliseconds?
-
Re: How do you set request timeout header in osapi?
pawans Dec 7, 2015 2:24 AM (in response to tahir_mirza@persistent.com)The read time out is in seconds,
And we have not set anything on our backend service for this.
We just have set this param on client side JS while calling jive connects service.
We are using this for osapi.jive.connects.post.
But i am sure this works exactly the same way for osapi.http.post
-
Re: How do you set request timeout header in osapi?
tahir_mirza@persistent.com Dec 13, 2015 12:34 AM (in response to pawans)I tried setting the parameter and it does not have any effect, the request timeout still occurs.
I cannot use osapi.jive.connects.post.because I am using custom tile and not an app.
So what exactly does this readTimeout parameter signifies? Does it mean that the keep-alive header is enabled or something else? From my understanding, client cannot set the keep alive header and it has to be enabled on server.
-
Re: How do you set request timeout header in osapi?
pawans Dec 13, 2015 1:31 AM (in response to tahir_mirza@persistent.com)I had found this in some of the old jive documentation.
May be some magic jive did with this.
-
-
- error: Object
-
-
Re: How do you set request timeout header in osapi?
bharatpec May 1, 2016 11:12 PM (in response to tahir_mirza@persistent.com)Hey guys,
Did you find a solution to this issue? We are facing the same issue. We can't set the time out to osapi.http.post.
B.
-
Re: How do you set request timeout header in osapi?
yogesh.r Aug 10, 2016 11:00 PM (in response to bharatpec)Scott A Johnson Rashed Talukder Matt Dickens Shipra Singh
I am working on JIVE external hosted app using the .net web api and angular js.
i' m facing the issue in posting the form values using the osapi.http.post. it return the Error 406 : Response is not valid json ,
but values are got inserted into DB
var notificaiton= "";//the below image values are passing to notification
var payload = {
"href": 'http://devsite.com/NotificationApp/api/Notifications/AddNotification',
"body":JSON.Stringfiy(notification),// Here i am posting my notification Object
"headers": {
"Content-Type": ["application/json"],
},
'format': 'json',
'authz': 'signed',
'noCache':true
};
console.log(payload) // please find the image below for payload
osapi.http.post(payload).execute(function(response) {
if (response.error) {
alert("Error " + response.error.code + " " + response.error.message);
} else {
alert("Successfully data sent to DB.")
}
})
};
Payload console.log image.
Please let me know.. is anything missing or modification required for the ospai.http.post
Thanks
Yogesh
-
Re: How do you set request timeout header in osapi?
Scott A Johnson Aug 11, 2016 11:46 AM (in response to yogesh.r)Hi Yogesh,
I've received this error before as well when the response from the service being called is not json (as it notes). If the service responds with an error or with a response other than json formatted text, the osapi wrapper in Jive will give you this error. I'd recommend validating the response from your external service is what you expect.
Thanks,
Scott
-
Re: How do you set request timeout header in osapi?
keerthanasundaram Oct 25, 2019 6:59 AM (in response to yogesh.r)Hi Yogesh,
I am also facing the same issue. Is there any wayfor this to be fixed. I have tried the solution which has been given by Scott but still it is not working. Can you please let us know the steps if the issue has been fixed.
Thanks,
Keerthana.S
-
-
Re: How do you set request timeout header in osapi?
markus@tembosocial.com Aug 26, 2016 5:25 AM (in response to bharatpec)Hi, I posted a new request here: Is there a way to set osapi.http request timeout settings / parameters as this seems to have been lost in the conversation.
-