Skip to content

Commit

Permalink
♻️ Simplify .http file + add cookie auth + align with endpoints explo…
Browse files Browse the repository at this point in the history
…rer.
  • Loading branch information
jasontaylordev committed Jun 27, 2023
1 parent aaddbca commit bdb7827
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 107 deletions.
7 changes: 0 additions & 7 deletions CleanArchitecture.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "playground", "playground", "{23C6AA70-9BAB-4963-973D-44D3274F34D8}"
ProjectSection(SolutionItems) = preProject
playground\TodoItems.http = playground\TodoItems.http
playground\TodoLists.http = playground\TodoLists.http
playground\WeatherForecast.http = playground\WeatherForecast.http
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
57 changes: 0 additions & 57 deletions playground/TodoItems.http

This file was deleted.

41 changes: 0 additions & 41 deletions playground/TodoLists.http

This file was deleted.

2 changes: 0 additions & 2 deletions playground/WeatherForecast.http

This file was deleted.

109 changes: 109 additions & 0 deletions src/WebUI/WebUI.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# For more info on HTTP files go to https://aka.ms/vs/httpfile
@WebUI_HostAddress = https://localhost:5001
@AuthCookieName = .AspNetCore.Identity.Application
@AuthCookieValue = <AuthCookieValue>

# GET WeatherForecast
GET {{WebUI_HostAddress}}/api/weatherforecast
Cookie: {{AuthCookieName}}={{AuthCookieValue}}

###

# GET TodoLists
GET {{WebUI_HostAddress}}/api/TodoLists
Cookie: {{AuthCookieName}}={{AuthCookieValue}}

###

#GET TodoList
GET {{WebUI_HostAddress}}/api/TodoLists/1
Cookie: {{AuthCookieName}}={{AuthCookieValue}}

###

# POST TodoLists
POST {{WebUI_HostAddress}}/api/TodoLists
Cookie: {{AuthCookieName}}={{AuthCookieValue}}
Content-Type: application/json

// CreateTodoListCommand
{
"Title": "Backlog"
}

###

# PUT TodoLists
PUT {{WebUI_HostAddress}}/api/TodoLists/1
Cookie: {{AuthCookieName}}={{AuthCookieValue}}
Content-Type: application/json

// UpdateTodoListCommand
{
"Id": 1,
"Title": "Product Backlog"
}

###

# DELETE TodoLists
DELETE {{WebUI_HostAddress}}/api/TodoLists/1
Cookie: {{AuthCookieName}}={{AuthCookieValue}}

###

# GET TodoItems
@PageNumber = 1
@PageSize = 10
GET {{WebUI_HostAddress}}/api/TodoItems?ListId=1&PageNumber={{PageNumber}}&PageSize={{PageSize}}
Cookie: {{AuthCookieName}}={{AuthCookieValue}}

###

# POST TodoItems
POST {{WebUI_HostAddress}}/api/TodoItems
Cookie: {{AuthCookieName}}={{AuthCookieValue}}
Content-Type: application/json

// CreateTodoItemCommand
{
"ListId": 1,
"Title": "Eat a burrito 🌯"
}

###

#PUT TodoItems UpdateItemDetails
PUT {{WebUI_HostAddress}}/api/TodoItems/UpdateItemDetails?Id=1
Cookie: {{AuthCookieName}}={{AuthCookieValue}}
Content-Type: application/json

// UpdateTodoItemDetailCommand
{
"Id": 1,
"ListId": 1,
"Priority": 3,
"Note": "This is a good idea!"
}

###

# PUT TodoItems
PUT {{WebUI_HostAddress}}/api/TodoItems/1
Cookie: {{AuthCookieName}}={{AuthCookieValue}}
Content-Type: application/json

// UpdateTodoItemCommand
{
"Id": 1,
"Title": "Eat a yummy burrito 🌯",
"Done": true
}

###

# DELETE TodoItem
DELETE {{WebUI_HostAddress}}/api/TodoItems/1
Cookie: {{AuthCookieName}}={{AuthCookieValue}}

###

0 comments on commit bdb7827

Please sign in to comment.