开发者

Multiple Requests with httpClient (appcelerator)

开发者 https://www.devze.com 2023-01-06 09:59 出处:网络
With appcelerator, I am attempting to send a picture with the twitp开发者_JAVA百科ic demo, I have created 2 text fields and when they are filled in I want to upload the image and those fields to twitp

With appcelerator, I am attempting to send a picture with the twitp开发者_JAVA百科ic demo, I have created 2 text fields and when they are filled in I want to upload the image and those fields to twitpic.

The problem with the app, is after I do it successfully the first time, (without closing the app) the second time doesn't send.

I need to somehow reset the httpClient open so it will re-open it.

Here is my code gist code


You could add xhr.abort() to the end of you updateSuccess function to close the open connection first

function networkUpdateSuccess() {
  alert('Success Uploaded',Ti.App.globalImage);
  win.rightNavButton = null;
  Ti.App.globalImage = null;
  whatText.value = '';
  whereText.value = '';
  actInd.hide();
  upload.hide();
  previewImage.image = '../images/upload_image.png';
  xhr.abort();
}


I had the same problem, and resolved to creating a new HttpClient every time I make a request.

0

精彩评论

暂无评论...
验证码 换一张
取 消