Apache/CXF

From Chorke Wiki
Jump to navigation Jump to search

Versioning

curl http://api.chorke.org/academia/api/v1.0.00/projects
curl http://api.chorke.org/academia/api/v1.0.01/projects
curl http://api.chorke.org/academia/api/v1.1.00/projects
curl http://api.chorke.org/academia/api/v1.1.10/projects

# curl http://api.chorke.org/academia/app/v1.1.10/projects
# curl http://api.chorke.org/academia/gui/v1.1.10/projects

JAX-RS

# find all
curl --request GET \
--url http://api.chorke.org/academia/api/v1.0.00/projects \
--header 'authorization: Basic dXNlcjpwYXNz' \
--header 'content-type: application/json' \
--header 'cache-control: no-cache'
# find by id
curl --request GET \
--url http://api.chorke.org/academia/api/v1.0.00/projects/1 \
--header 'authorization: Basic dXNlcjpwYXNz' \
--header 'content-type: application/json' \
--header 'cache-control: no-cache'
# create/save
curl --request POST \
--url http://api.chorke.org/academia/api/v1.0.00/projects \
--header 'authorization: Basic dXNlcjpwYXNz' \
--header 'content-type: application/json' \
--header 'cache-control: no-cache' \
--data '{"name": "Academia"}'
# update by id
curl --request PUT \
--url http://api.chorke.org/academia/api/v1.0.00/projects/1 \
--header 'authorization: Basic dXNlcjpwYXNz' \
--header 'content-type: application/json' \
--header 'cache-control: no-cache' \
--data '{"id": "1", "name": "Academia"}'
# delete by id
curl --request DELETE \
--url http://api.chorke.org/academia/api/v1.0.00/projects/1 \
--header 'authorization: Basic dXNlcjpwYXNz' \
--header 'content-type: application/json' \
--header 'cache-control: no-cache' \
--data '{"id": "1", "name": "Academia"}'


References