Ajax type POST result 404

  • 1
  • Problem
  • Updated 4 years ago
I am new to phonegap and i want to make an ajax request to webserver script written in PHP laravel framework, when i make the ajax method "POST" the result is 404, and when i convert it to type "GET" it works good, i don't know how to solve this problem, also when I call the ajax before the initialaization of phonegap assets it works good, that is mean the phonegap proxy makes the problem.
Photo of محمد المشيقح

محمد المشيقح

  • 6 Posts
  • 0 Reply Likes
  • sad

Posted 4 years ago

  • 1
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
The....Phonegap proxy??? What proxy?

1. On what platform/device did you test the communication?
2. What PGB version do you use to build?
3. How did you whitelist the external domain?
Photo of محمد المشيقح

محمد المشيقح

  • 6 Posts
  • 0 Reply Likes
the path of webservice like this:

http://localhost/login

phonegap converts it to something like:
192.186.104.8:3000/proxy/YourURL

I did not build the app, I am using the browser to test on the PC
Photo of محمد المشيقح

محمد المشيقح

  • 6 Posts
  • 0 Reply Likes
also i have used the wihtlist on the config xml , and in the php script with no avail
Photo of محمد المشيقح

محمد المشيقح

  • 6 Posts
  • 0 Reply Likes
the path of webservice like this:

http://localhost/login

phonegap converts it to something like:
192.186.104.8:3000/proxy/YourURL

I did not build the app, I am using the browser to test on the PC
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
1. It is not Phonegap that converts localhost to that local IP address.
2. If you are using the browser to test your html (without building the app), you should have nothing to do with config.xml and whitelisting.
3. Are you using Phonegap Build, the cloud service, at all?
(If not, you might be lost here a bit)
Photo of محمد المشيقح

محمد المشيقح

  • 6 Posts
  • 0 Reply Likes
no, i just use the phonegap serve to test my app functionlity and i have an error with POST using ajax.

i did not build the app i am using just the browser to test my app, i am still at development stage
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Obviously, you have installed Phonegap, SDK's, plugins (etc) and you created a project, using the CLI.

Building locally is not what this forum is about, so yes, you appear a bit lost here. This is the Phonegap Build forum, for developers who don't install Phonegap and all that.

You might be better off asking your question in the Phonegap Google Group.
Photo of محمد المشيقح

محمد المشيقح

  • 6 Posts
  • 0 Reply Likes
can you give me a link ?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Sure, it's in the right column of the main page of this forum.