YouTrackSharp doesn't allow attaching files
First, per the instructions of YouTrackSharp I tried to submit an issue to youtrack.codebetter.com and couldn't access the site.
So I'm asking here:
When I try to attach a file, I get a NotAcceptable status back. Are attaching files supported by YouTrackSharp?
Here is the message:
EasyHttp.Infrastructure.HttpException : NotAcceptable Not Acceptable
in HttpClient.cs: line 208
in HttpClient.cs: line 151
in c:\Users\VK185077\Downloads\YouTrackSharp-master\YouTrackSharp-master\src\YouTrackSharp\Infrastructure\Connection.cs: line 120
in c:\Users\VK185077\Downloads\YouTrackSharp-master\YouTrackSharp-master\src\YouTrackSharp\Issues\IssueManagement.cs: line 155
So I'm asking here:
When I try to attach a file, I get a NotAcceptable status back. Are attaching files supported by YouTrackSharp?
Here is the message:
EasyHttp.Infrastructure.HttpException : NotAcceptable Not Acceptable
at EasyHttp.Http.HttpClient.ProcessRequest(String filename)
at EasyHttp.Http.HttpClient.Post(String uri, IDictionary`2 formData, IList`1 files, Object query)
at YouTrackSharp.Infrastructure.Connection.PostFile(String command, String path)
at YouTrackSharp.Issues.IssueManagement.AttachFileToIssue(String issuedId, String path)
Please sign in to leave a comment.
Could you please provide HTTP request that is actually sent to the server?
public void PostFile(string command, string path) { HttpClient httpRequest = this.CreateHttpRequest(); httpRequest.Request.Accept = "application/xml"; string fileContentType = this.GetFileContentType(path); List<FileData> list = new List<FileData>() { new FileData() { FieldName = "file", Filename = path, ContentTransferEncoding = "binary", ContentType = fileContentType } }; httpRequest.Post(this._uriConstructor.ConstructBaseUri(command), (IDictionary<string, object>) null, (IList<FileData>) list, (object) null); this.HttpStatusCode = httpRequest.Response.StatusCode; }