fixe l'envoi du selfy en avatar
This commit is contained in:
parent
79e5eaeece
commit
e3d2cab067
1 changed files with 6 additions and 1 deletions
|
|
@ -58,9 +58,14 @@ namespace ZicMoove.Pages.UserProfile
|
||||||
{
|
{
|
||||||
using (var stream = file.GetStream())
|
using (var stream = file.GetStream())
|
||||||
{
|
{
|
||||||
|
var requestContent = new MultipartFormDataContent();
|
||||||
var content = new StreamContent(stream);
|
var content = new StreamContent(stream);
|
||||||
|
var filename = "me.jpg";
|
||||||
|
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
|
||||||
|
content.Headers.Add("Content-Disposition", $"form-data; name=\"file\"; filename=\"{filename}\"");
|
||||||
|
requestContent.Add(content, "file", filename);
|
||||||
|
|
||||||
using (var response = await client.PostAsync(Constants.YavscApiUrl + "/setavatar", content))
|
using (var response = await client.PostAsync(Constants.YavscApiUrl + "/setavatar", requestContent))
|
||||||
{
|
{
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue