Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

PascalRESTLearn

Learning to build a REST server using Pascal

View on Codeberg

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

PascalRESTLearn curates Pascal code examples for building REST servers, designed to support learning.

Status

Work in progress

Prerequisites

  • make (tested with GNU Make)
  • fpc (Free Pascal Compiler)

Build

bash
make

Run

bash
./hello_world_rest_server

Usage

With a running server:

bash
curl http://localhost:8080/api/message

Dict REST Server

Run

bash
./dict_rest_server

Usage

Add item

bash
curl -H 'Content-Type: application/json' \
     -d '{"headword":"cat", "part_of_speech":"noun"}' \
     localhost:8080/api/dict
bash
curl -H 'Content-Type: application/json' \
     -d '{"headword":"go", "part_of_speech":"verb"}' \
     localhost:8080/api/dict

Get items

bash
curl localhost:8080/api/dict