victordiaz / PHONK

PHONK is a coding playground for new and old Android devices

Home Page:https://phonk.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

victordiaz opened this issue · comments

Problem description
Discovered this issue through #89

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

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)
  })