weixin_33695082 2013-03-06 23:39 采纳率: 0%
浏览 15

测试AJAX Post的简单方法? [关闭]

                <div class="grid--cell fl1 lh-lg">
                    <div class="grid--cell fl1 lh-lg">
                        It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and   cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened,   <a href="/help/reopen-questions">visit the help center</a>.

                    </div>
                </div>
            </div>
            <div class="grid--cell mb0 mt8">Closed <span title="2013-03-07 02:25:10Z" class="relativetime">7 years ago</span>.</div>
        </div>
    </aside>

I have an app setup that continually sends a value via AJAX POST.

I need to know whether the POST is happening and sending the correct values.

Are there ways to do this that don't involve setting up a database to store received values?

</div>
  • 写回答

1条回答 默认 最新

  • weixin_33697898 2013-03-06 23:41
    关注

    On PHP side do just a

     var_dump($_POST);
    

    or if you need that in a file

    // Make sure that 'debug.txt' is writable
    file_put_contents('debug.txt', print_r($_POST), true));
    

    Update: Seems that I've not read the question carefully. I first thought that you are looking for some client side tools for testing. So I wrote the following answer.. However it may be interesting too for you and therefore I didn't deleted it...

    If you are working with firefox I like the poster plugin. It's a nice tool to test all sorts of HTTP requests

    If you prefer the command line (like me) I would suggest to use wget or curl

    Using curl:

    curl --data "param1=value1&param2=value2" http://yourserver/your.php
    

    Using wget:

    wget -O - --post-data="param1=value1&param2=value2" http://yourserver/your.php
    
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!