proxy-ws:代理网络服务

  • T3_981499
    了解作者
  • 8.4MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-25 20:05
    上传日期
#API 端点 要求 :将用户请求转换为带有字段的意图 : 提交处理请求 : 从存储中获取请求 :修改请求(例如更改其状态) 帐户 : 注册一个用户 :更新用户 : 验证用户 发布/translate { "request":"Make a reservation tomorrow at 8pm at House of Prime Rib" } 200 正常 { "result": { "intent": "RESTAURANT_RESERVATION", "missingFields": [ { "friendlyString": "For how many people?", "name": "partySize",
proxy-ws-master.zip
内容介绍
#API Endpoints ##### Request * [POST /translate](README.md#post-translate): translates a user request into a an intent with fields * [POST /request](README.md#post-request): submits a request for processing * [GET /request?status=<status>](README.md#get-requeststatusstatus): gets requests from storage * [PUT /request/id/<id>](README.md#put-requestidid): modifies a request (e.g. change its state) ##### Account * [POST /account](README.md#post-account): registers a user * [PUT /account](README.md#put-account): updates a user * [POST /authenticate](README.md#post-authenticate): authenticates a user * * * ## POST `/translate ` ``` { "request":"Make a reservation tomorrow at 8pm at House of Prime Rib" } ``` __200 OK__ ``` { "result": { "intent": "RESTAURANT_RESERVATION", "missingFields": [ { "friendlyString": "For how many people?", "name": "partySize", "type": "Integer", } ], "validatedFields": [ { "friendlyString": "Where?", "name": "restaurant", "type": "String", "value": "House of Prime Rib" }, { "friendlyString": "When?", "name": "dateTime", "type": "String", "value": "2014-11-04T04:00:00+0000" } ], "confirmation": "We'll make a reservation at $restaurant for $partySize people at $dateTime." }, "error": null } ``` ## POST `/request` ``` { "intent": "RESTAURANT_RESERVATION", "dateTime": "2014-11-04T04:00:00+0000", "partySize": 3, "restaurant": "House of Prime Rib" } ``` __200 OK__ ``` { "result": { "request": { "id": "REQUEST1946742199", "intent": "RESTAURANT_RESERVATION", "requesterId": "USER1633233668", "status": "QUEUED", "created": "2014-11-03T05:03:02+0000", "dateTime": "2014-11-04T04:00:00+0000", "partySize": 3, "restaurant": "House of Prime Rib" } }, "error": null } ``` __400 bad request__ ``` { "result": null, "error": { "code": 400, "message": "Valid party size must be specified" } } ``` ## GET `/request?status=<status>` Gets all requests where the status is one of the enum `QUEUED`, `PROCESSING`, or `DONE` ``` { "result": { "requests": [ { "id": "REQUEST1946742199", "intent": "RESTAURANT_RESERVATION", "requesterId": "USER1633233668", "status": "QUEUED", "created": "2014-11-03T05:03:02+0000", "dateTime": "2014-11-04T04:00:00+0000", "partySize": 3, "restaurant": "House of Prime Rib" } ] }, "error": null } ``` ## PUT `/request/id/<id>` ``` { "status": "DONE" } ``` __200 OK__ ``` { "result": { "request": { "id": "REQUEST1946742199", "intent": "RESTAURANT_RESERVATION", "requesterId": "USER1633233668", "status": "DONE", "created": "2014-11-03T05:03:02+0000", "dateTime": "2014-11-04T04:00:00+0000", "partySize": 3, "restaurant": "House of Prime Rib" } }, "error": null } ``` ## POST `/account` ``` { "email": "allenwoot@gmail.com", "number": "6363366066", "firstName": "Allen", "lastName": "Wu", "password": "super_secure_password", "userType": "USER", "deviceToken": "203f9j0293jf092j3" } ``` __200 OK__ ``` { "result": { "user": { "authToken": "AUTHVVNFUjE4Mjk4ODMyMjRAMTQxNDk4OTI4NjcxNg==", "email": "allenwoot@gmail.com", "firstName": "Allen", "id": "USER1829883224", "lastName": "Wu", "number": "6363366066", "password": "super_secure_password", "userType": "USER", "deviceToken": "203f9j0293jf092j3" } }, "error": null } ``` __400 BAD REQUEST__ ``` { "result": null, "error": { "code": 400, "message": "Missing field {email}" } } ``` ## POST `/authenticate` ``` { "email": "allenwoot@gmail.com", "password": "doge" } ``` __200 OK__ ``` { "result": { "user": { "authToken": "AUTHVVNFUjE2MzMyMzM2NjhAMTQxNDk4OTk0NDY1OA==", "email": "allenwoot@gmail.com", "firstName": "Allen", "id": "USER1633233668", "lastName": "Wu", "number": "6363366066", "password": "super_secure_password", "userType": "USER", "deviceToken": "203f9j0293jf092j3" } }, "error": null } ``` __403 FORBIDDEN__ ``` { "result": null, "error": { "code": 403, "message": "Authentication failed" } } ``` An authentication token must be passed with every request (with the exception of post account and post authenticate), as a header keyed with "Auth-Token". 401 UNAUTHORIZED ``` { "result": null, "error": { "code": 401, "message": "Invalid or expired auth token" } } ```
评论
    相关推荐
    • ProxyCmd:代理命令行分配源代码存储库-Proxy source code
      代理命令行分配源代码存储库。 问题陈述:- HA应该在HM(HM的端口X)和HA(HA的端口Y)之间创建隧道。 隧道1(这是远程隧道) HA应该在HA(端口Y)和Switch 22之间创建隧道。Tunnel -2(这是本地隧道) 以编程...
    • Proxy Auto Auth-crx插件
      语言:English 此扩展使您能够在设置凭据后自动对您的代理进行身份验证。 ... 完成后,您将永远不会再次看到任何代理登录弹出窗口。 正如您所看到的,代理Auto Auth... 但请确保您的任何数据都没有以任何方式存储或使用。
    • strava-heatmap-proxy
      strava-heatmap-proxy 这是一个简单的允许未经身份验证的个人和全局Strava热图访问。 注意:您将*需要是Strava溢价用户使用此。 设置 在Strava桌面上登录后,使用devtools查找每个cookie的值。 然后使用将这些作为...
    • proxy2objectstorage:仅通过此代理访问对象存储
      proxy2objectstorage 仅通过此代理访问对象存储 通过您自己的REST API访问对象 具有PAR的另一个选项 限制对特定IP地址的访问 ( )
    • proxy:代理程序包的源代码的只读存储库-Proxy source code
      proxy:代理程序包的源代码的只读存储
    • m2-proxy-开源
      Maven 2存储库代理。 简化了Maven远程存储库的镜像。
    • host-proxy-crx插件
      语言:中文 (简体) ...本地启动的服务,对localhost域名进行映射,可以选择对应的环境,方便开发者切换对应环境1.0.3 页面打包处理1.0.2 增加设置domin功能,增加删除功能1.0.1修复多窗口不兼容问题,修改存储方式
    • ndarray-proxy:将函数转换为 ndarrays
      但是,与密集数组不同,它们不保留任何存储空间,而是使用函数来确定数组的内容。 这是一个简单的例子: var proxy = require ( 'ndarray-proxy' ) //Create a 10x10 proxy ndarray var x = proxy ( [ 10 , 10 ] ...
    • proxy_cors_bypasser
      GamesModPlus的proxy_cors_bypasser V4.3,如果在您的项目中使用此功能,我们将不胜感激与其共享凌乱的api,我只是决定为我的proxy_cors_bypasser模块创建一个单独的存储库,因为这是您唯一需要的代码。 稍后,我将...
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档