...
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using BlazorBootstrap;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace Front.Services
|
||||
{
|
||||
@@ -32,6 +37,18 @@ namespace Front.Services
|
||||
if (request.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
_nav.NavigateTo("/Sign-in/unon");
|
||||
return request;
|
||||
}
|
||||
public async Task<HttpResponseMessage> Put(string route)
|
||||
{
|
||||
var jsonString = "{\"appid\":1,\"platformid\":1,\"rating\":3}";
|
||||
var httpContent = new StringContent(jsonString, Encoding.UTF8, "application/json");
|
||||
var response = await _hc.PutAsync(route, httpContent);
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
_nav.NavigateTo("/Sign-in/unon");
|
||||
return response;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user