Hi Manoj,
No i'm calling to a external resource in server side using jaggery POST
method to retrieve some attributes. As per the documentation On success
callback there is a success method. Is there a method to handle failure use
cases as well? As for now using following code i'm checking the status code
to verify whether its success or not.
var result = post(url, {
"code" : CODE,
"client_id" : C_ID,
"client_secret" : C_SEC,
"redirect_uri" : REDIRECT,
"grant_type" : TYPE,
},
{
"User-Agent" : "Jaggery-XHR",
"Country" : "LK"
}, 'json');
var code=result.xhr.status;
Regards,
Damith.
On Fri, Oct 17, 2014 at 1:51 PM, Manoj Gunawardena <[email protected]> wrote:
> Hi Damith,
>
> Not clear your requirement. Post into jag mean? Are you trying to call JAG
> APi from java script? Please share the client code and JAg code.
>
> Thanks
>
> On Thu, Oct 16, 2014 at 7:10 PM, Damith Wickramasinghe <[email protected]>
> wrote:
>
>> Hi,
>>
>> I have developed a Jaggery app to our training project and i needed to do
>> a Jaggery post and handle some error cases if the response fails. I went
>> through the documentation but i could not find a Post error method. So as
>> for a work around i checked the returned code using userInfo.xhr.status and
>> did the logic. I'm not sure whether its a good approach to do so. Can some
>> please tel me if there's a method to handle that.
>>
>> For success the method is,
>>
>> success(data:Object,
>> xhr:Object)
>>
>> as per the documentation.
>>
>> Regards,
>> Damith
>>
>> --
>> Software Engineer
>> WSO2 Inc.; http://wso2.com
>> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
>> lean.enterprise.middleware
>>
>> mobile: *+94728671315 <%2B94728671315>*
>>
>>
>
>
> --
> Manoj Gunawardena
> Tech Lead
> WSO2, Inc.: http://wso2.com
> lean.enterprise.middleware
> Mobile : +94 77 2291643
>
--
Software Engineer
WSO2 Inc.; http://wso2.com
<http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
lean.enterprise.middleware
mobile: *+94728671315*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev