aspnet_rest_api
1.0.0
솔루션을 다운로드하거나 복제하십시오. Visual Studio 2017을 사용하여 열 수 있습니다.
Open Visual Studio 2017 명령을 관리자 권한을 사용하여 프롬프트합니다. 테스트 프로젝트의 출력 폴더로 찾으십시오 (예 : Aspnet_rest_api aspnet_rest_api.tests bin debug) 아래 명령을 실행하십시오.
vstest.console.exe aspnet_rest_api.Tests.dll GET http://localhost:4870/api/products
샘플 응답
{
"products" : [
{
"id" : 1 ,
"link" : " http://localhost:4870/api/products/1 "
},
{
"id" : 2 ,
"link" : " http://localhost:4870/api/products/2 "
}
],
"id" : " 09bfc752-843e-4a67-a346-cd98a194646e " ,
"timestamp" : 1534617504
} GET http://localhost:4870/api/products/{id}
샘플 응답
{
"product" : {
"id" : 1 ,
"name" : " Guitar " ,
"quantity" : 30 ,
"sale_amount" : 10
},
"id" : " c69a1027-f3df-4018-9e2c-cc54e05144c7 " ,
"timestamp" : 1534618031
} PUT http://localhost:4870/api/products
샘플 페이로드
[{
"name" : " Another Amp 3 " ,
"quantity" : 14 ,
"sale_amount" : 26
}, {
"name" : " Another Amp 4 " ,
"quantity" : 11 ,
"sale_amount" : 22
},
{
"name" : " Another Amp 5 " ,
"quantity" : 100 ,
"sale_amount" : 20
}]샘플 응답
{
"id" : " 6bfb3073-ed81-47e7-859b-bfa1013d5086 " ,
"timestamp" : 1534617507
}