This repository contains a test application for API processing of form data. Written without the use of frameworks.
To run, you need to have docker, docker-compose installed.
make install
make start
make stop
make build
make help
The REST API to the example app is described below.
POST http://127.0.0.1:8888/form
curl --location --request POST 'http://127.0.0.1:8088/form' \
--form 'email="[email protected]"' \
--form 'phoneNumber="+380507776672"' \
--form 'message="Test message"'
HTTP/1.1 201 Created
Date: Sun, 22 May 2022 11:57:58 GMT
Status: 201 Created
Connection: close
Content-Type: application/json
Location: /form
{"formId":1}
POST http://127.0.0.1:8888/form
curl --location --request POST 'http://127.0.0.1:8088/form' \
--form 'message="Test message"'
HTTP/1.1 400 Bad Request
Date: Sun, 22 May 2022 11:57:58 GMT
Status: 400 Bad Request
Connection: close
Content-Type: application/json
Location: /form
{ "email": "The Email is required", "phoneNumber": "The PhoneNumber is required" }
POST http://127.0.0.1:8888/form
curl --location --request POST 'http://127.0.0.1:8088/form' \
--form 'email="[email protected]"' \
--form 'phoneNumber="+380507776672"' \
--form 'message="Test message"'
HTTP/1.1 500 Internal Server Error
Date: Sun, 22 May 2022 11:57:58 GMT
Status: 500 Internal Server Error
Connection: close
Content-Type: application/json
Location: /form
{"message":"Internal server error"}