jQuery AJAX/POST not sending data to PHP

前端 未结 7 1412
春和景丽
春和景丽 2020-12-29 03:54

So I have this problem for a while now, and I know there are countless questions on this topic, believe me I tried every solution possible but still does not work.

T

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 04:52

    I recently came across this issue but because of other reasons:

    1. My POST data was redirected as 301
    2. My Server request was GET
    3. I did not get my POST data

    My reason - I had a url on the server registered as:

    http://mywebsite.com/folder/path/to/service/
    

    But my client was calling:

    http://mywebsite.com/folder/path/to/service
    

    The .htaccess on the server read this as a 301 GET redirect to the correct URL and deleted the POST data. The simple solution was to double check the url path.

    @C.Ovidiu, @MarcB - Both of you guys saved me lots of hours in debugging!

提交回复
热议问题