项目作者: llfrometa89

项目描述 :
Proof of concept: http4s library
高级语言: Scala
项目地址: git://github.com/llfrometa89/poc-http4s.git
创建时间: 2019-03-24T21:58:17Z
项目社区:https://github.com/llfrometa89/poc-http4s

开源协议:MIT License

下载


poc-http4s

Prerequisites

To follow this Readme you need to have installed: cURL or HTTPie

Create Account

Request

  1. $ curl -d '{"name":"Livan","email":"example@example.com", "amount":200}' -X POST http://localhost:9000/accounts
  2. or
  3. $ http POST :9000/accounts name="Livan" email=:"example@example.com" amount=200

Response

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. {
  4. "no": "1546"
  5. }

Transfer Money

Request

  1. curl -d '{"senderAccountNo":"8135","receiverAccountNo":"287", "amount":100}' -X POST http://localhost:9000/accounts/transfer
  2. or
  3. http POST :9000/accounts/transfer senderAccountNo="8135" receiverAccountNo="287" amount=200

Response

  1. Success transfer

Resources