TheSmiths-Widgets / ts.httprequest

[unmaintained] Request library creates and handles HTTP request using Titanium's HTTPClient.
14 stars 3 forks source link

Still with problem Promises #6

Closed DouglasHennrich closed 8 years ago

DouglasHennrich commented 8 years ago

I'm sorry but it still not working ): Alloy.js:

// HTTP Request
Alloy.Globals.HTTPRequest = require('ts.httprequest');

main.js:

function handleError(error){
    console.log('Error: ', JSON.stringify(error));
};

function handleSuccess(success){
    console.log('handleSuccess: ', JSON.stringify(success));
};

var request = new Alloy.Globals.HTTPRequest({
        method: "GET"
      , url: "http://www.google.com"
      , data: { }
}).then(handleSuccess).catch(handleError);

terminal output:

[INFO]  HTTPRequest handleSuccess for url (GET) http://www.google.com
[ERROR] : Event loop not supported.

tiapp.xml:

<module platform="commonjs" version="1.4.2">ts.httprequest</module>

<sdk-version>5.1.1.GA</sdk-version>
KtorZ commented 8 years ago

Sorry, we were switching between the compiled version and the standalone version for testing and a little typo slipped in :/ I've just tested with your example and it's work fine. Let us know if you still have any trouble, and thanks for feedbacks !

DouglasHennrich commented 8 years ago

You're welcome :+1: :)

DouglasHennrich commented 8 years ago

@KtorZ can you provide .zip file, please? since Gittio it takes 1 day to update =(

KtorZ commented 8 years ago

The zip is correct, you can already use it (I bumped the version after creating the build :/) I will update it later ^^

DouglasHennrich commented 8 years ago

oh hahaha ok Thanks