如何找到api文件的扩展名 [英] How do I find the extension for a api file

查看:106
本文介绍了如何找到api文件的扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个api文件:api / orders。

我需要订单的文件扩展名。

我试过:



orders.txt

orders.json



两者都没有。



这是我的api /订单文件:



I have an api file: "api/orders".
I need the file extension for "orders".
I have tried:

orders.txt
orders.json

Neither worked.

Here is my api/orders file:

API

------
Get All Orders

GET request to /api/orders
Sample Response:
[
	{
		id:1,
		name: 'James',
		drink: 'Coffee'
	},
	{
		id: 2,
		name: 'John',
		drink: 'Latte'
	},
]







<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        $.ajax({
            type: 'GET',
            url: '/api/orders',
            success: function(...
            },
            error: function () {
                alert('Error');
            }
        });
</script>

推荐答案

function (){


.ajax({
type:' GET'
url:' / api / orders'
成功: function (...
},
错误: function (){
alert(' 错误');
}
});
< / script>
.ajax({ type: 'GET', url: '/api/orders', success: function(... }, error: function () { alert('Error'); } }); </script>


'api / orders'不是文件,而是网络服务上的操作/命令...

根据您提供的示例,它以JSON格式返回答案...
'api/orders' is not a file but an action/command on a web service...
According to the sample you provided it returns answer in JSON format...


这篇关于如何找到api文件的扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆