victordiaz / PHONK

PHONK is a coding playground for new and old Android devices
https://phonk.app
GNU General Public License v3.0
457 stars 27 forks source link

httpRequest method not giving proper feedback when trying to upload a non-existing file #91

Open victordiaz opened 3 years ago

victordiaz commented 3 years ago

Problem description Discovered this issue through https://github.com/victordiaz/PHONK/issues/89

Steps to reproduce the bug Copy the HTTP Post content to a different project (without the .png file) and execute

Slord6 commented 3 years ago

Closely related; if the data structure for the data of a http request is missing the name, data or type property the script crashes with no error to the console. Example:

network.httpRequest({
    method: 'POST',
    url: url,
    data: [
      { 'content': JSON.stringify(data), 'type': 'json' }, //problem
    ]
  }).onResponse(function (e) {
    console.log(e.status, e.response)
  })