GithubHelp home page GithubHelp logo

future-lab-api's Introduction

Future Lab API

path:https://future-lab-api-v1.herokuapp.com

  1. 門禁管理
  1. 物料管理
  • null

用戶註冊

[API]:/user/register
[方法]:POST
[參數]:
    {
        "uid": "RFID 內容"
    }
[成功回應]:
    {
        "success": true,
        "message": "註冊成功",
        "uid": "RFID 內容",
    }
[失敗回應 - 重複註冊]:
    {
        "success": false,
        "message": "重複註冊,操作失敗",
    }
[失敗回應 - 異常處理]:
    {
        "success": false,
        "message": "操作失敗,請重新在試一次",
    }

用戶檢查

[API]:/user/check
[方法]:POST
[參數]:
    {
        "uid":"RFID 內容"
    }
[成功回應 - 進入實驗室]:
    {
    "success": true,
    "messgae": "通過驗證,以紀錄進入時間",
    "time": 1586956684067
    }
[成功回應 - 離開實驗室]:
    {
    "success": true,
    "messgae": "通過驗證,以紀錄離開時間",
    "time": 1586956720750
    }
[失敗回應 - 不存在資料庫 | 權限遭移除]:
    {
    "success": false,
    "message": "此用戶沒有權限進入,請連絡相關管理員"
    }

請求範例

Python:

import requests
import json

# path
rq_url = "https://future-lab-api-v1.herokuapp.com" + '/user/check'

# header ( JSON 型式)
rq_headers = {"Content-Type":"application/json"}

# header ( Form 型式)
# rq_headers = {"Content-Type":"application/x-www-form-urlencoded"}

# data ( JSON 型式)
rq_payload = {"uid":"u2"}

# data ( Form 型式)
# rq_payload = "uid=u2"

# response ( JSON 型式)
res = requests.post(rq_url, headers=rq_headers, data=json.dumps(rq_payload))

# response ( Form 型式)
# res = requests.post(rq_url, headers=rq_headers,data=rq_payload)

# do something
resData = json.loads(res.text);
print(resData)

future-lab-api's People

Contributors

awdr74100 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.