question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

POST is not working with strange error

See original GitHub issue

Hi, I can do a GET request without any problems. The PHP script also works well for POST requests, but when I do a POST request from my ionic app, I always get this error:

{"__zone_symbol__currentTask":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"angular","cancelFn":null,"runCount":0},"line":86,"column":22,"sourceURL":"file:///var/containers/Bundle/Application/FAC1A964-4A4A-4081-B9DA-B3D3F1E1BEC1/App.app/www/plugins/cordova-plugin-advanced-http/www/helpers.js"}

I couldn’t find any help so far. Am I doing something wrong? Here is my ionic code:

let postData = new FormData()
  postData.append('s_id',this.s_id)
  postData.append('klasse',this.klasse.id)
  postData.append('stunde',this.stunde.id)
  postData.append('uebungen',JSON.stringify(this.uebungen))
  postData.append('wo_id',woid)

const options = {
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
};

this.http.post(
      'URL.php/', 
      postData,
      options
     )
     .then(response => {
        // prints 200
        console.log("Response-Status: "+response.status);
        try {
          response.data = JSON.parse(response.data);
          // prints test
          console.log("Response-Message: "+response.data.message);
        } catch(e) {
          console.error('JSON parsing error');
        }
     })
     .catch(response => {
       // prints 403
       console.log("Response: "+JSON.stringify(response));
      }
     });

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mistergamarracommented, Apr 10, 2020

Hi @bastifix you can use adb logcat in the terminal to check out more about you error in low level of your app.

I usually install my app on one device and use chrome://inspect/#devices and logcat to debug my Ionic application.

cheers.

0reactions
silkimencommented, Apr 21, 2020

Closing this, feel free to open a new issue, if this won’t solve your problem! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Post request with strange behavior
I ran the application totally in my local environment (changed my request to my local server as opposed to the one hosted on...
Read more >
POST request not properly authenticated error? (Get ...
I'm trying to figure out why I get an error saying “This request is not properly authenticated” when trying out the following command?...
Read more >
Topic: Strange error on post
I have a band messageboard that's worked flawlessly for a year now… but when I tried posting myself just now, it didn't appear...
Read more >
Solved: Re: [Strange Error]: Unable to connect to the data ...
1) my developer generated a link to the datasource which returns the data into the format of JSON. This data is before 06/04/2022....
Read more >
11 Common Facebook Problems and Errors (And How to ...
Here are fixes for the most annoying Facebook issues and errors you'll come ... We all know someone who posts all the time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found