Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This is a sample ASP.NET Core WebAPI

NotificationsYou must be signed in to change notification settings

CodeRef/ASPNETCore-WebAPI-Sample

 
 

Repository files navigation

In this repository I want to give a plain starting point at how to build a WebAPI with ASP.NET Core.

This repository contains a controller which is dealing with FoodItems. You can GET/POST/PUT/PATCH and DELETE them.

Hope this helps.

See the examples here:

Versions

http://localhost:29435/swagger

ASPNETCOREWebAPIVersions

GET all Foods

http://localhost:29435/api/v1/foods

ASPNETCOREWebAPIGET

GET single food

http://localhost:29435/api/v1/foods/2

ASPNETCOREWebAPIGET

POST a foodItem

http://localhost:29435/api/v1/foods

{"name":"Lasagne","type":"Main","calories":3000,"created":"2017-09-16T17:50:08.1510899+02:00"}

ASPNETCOREWebAPIGET

PUT a foodItem

http://localhost:29435/api/v1/foods/5

{"name":"Lasagne2","type":"Main","calories":3000,"created":"2017-09-16T17:50:08.1510899+02:00"}

ASPNETCOREWebAPIGET

PATCH a foodItem

http://localhost:29435/api/v1/foods/5

[{"op":"replace","path":"/name","value":"mynewname"}]

ASPNETCOREWebAPIGET

DELETE a foodItem

http://localhost:29435/api/v1/foods/5

ASPNETCOREWebAPIGET

Releases

No releases published

Packages

No packages published

Languages

  • C#100.0%

[8]ページ先頭

©2009-2025 Movatter.jp