Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/calebmadrigal/web-api-test

.NET WebAPI Test
https://github.com/calebmadrigal/web-api-test

Last synced: about 1 month ago
JSON representation

.NET WebAPI Test

Awesome Lists containing this project

README

        

# web-api-test

Demonstrates how to build a simple RESTful API with .NET WebAPI.

## Usage

### List

curl http://localhost:49990/api/product

Example Response:

{
"Data": [
{
"id": "0",
"name": "Chai"
},
{
"id": "1",
"name": "Espresso"
},
{
"id": "2",
"name": "Smoothie"
}
]
}

### Get

curl http://localhost:49990/api/product/1

Example response:

{
"Data": {
"id": "1",
"name": "Espresso"
}
}

### Create

curl -X POST http://localhost:49990/api/product -H "Content-Type: application/json" -d "{'name': 'Juice'}"

### Update

curl -X PUT http://localhost:49990/api/product/1 -H "Content-Type: application/json" -d "{'name': 'Juice'}"