Skip to content

Commit

Permalink
[Fix] Upload file for attachment (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
zapadi authored Aug 26, 2024
1 parent cdaa0af commit 8c24137
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public ApiResponseMessage Download(string address, RequestOptions requestOptions
public ApiResponseMessage Upload(string address, byte[] data, RequestOptions requestOptions = null)
{
var content = new ByteArrayApiRequestMessageContent(data);
return HandleRequest(address, HttpVerbs.UPLOAD, requestOptions, content);
return HandleRequest(address, HttpVerbs.POST, requestOptions, content);
}

#if !(NET20)
Expand Down Expand Up @@ -160,7 +160,7 @@ public async Task<ApiResponseMessage> UpdateAsync(string address, string payload
public async Task<ApiResponseMessage> UploadFileAsync(string address, byte[] data, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
var content = new ByteArrayApiRequestMessageContent(data);
return await HandleRequestAsync(address, HttpVerbs.UPLOAD, requestOptions, content, cancellationToken:cancellationToken).ConfigureAwait(false);
return await HandleRequestAsync(address, HttpVerbs.POST, requestOptions, content, cancellationToken:cancellationToken).ConfigureAwait(false);
}

public async Task<ApiResponseMessage> PatchAsync(string address, string payload, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -350,4 +350,4 @@ private static string GetContentType(IRedmineSerializer serializer)
return serializer.Format == RedmineConstants.XML ? RedmineConstants.CONTENT_TYPE_APPLICATION_XML : RedmineConstants.CONTENT_TYPE_APPLICATION_JSON;
}
}
}
}

0 comments on commit 8c24137

Please sign in to comment.