'Post an attachement to jira c#

I am trying to post an attachement to JIRA but getting a 404 http error .

I did post some comments before and it's working fine.

MY Code below

                string jsmlogin = "****";
            string jsmpass = "****";
   string _auth = string.Format("{0}:{1}", jsmlogin, jsmpass);
            string _enc = Convert.ToBase64String(Encoding.ASCII.GetBytes(_auth));
            string _cred = string.Format("{0} {1}", "Basic", _enc);
            string projKey = "DESK-1993";


            string postUrl = "https://******/rest/servicedeskapi/request/" + projKey + "/attachments";
            string jsmproxy = "http://********";
           
            
             var clientHandler = new HttpClientHandler();
            clientHandler.Proxy = new WebProxy(jsmproxy, true);
       
           HttpClient client = new HttpClient(clientHandler);

            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", _enc);
            client.DefaultRequestHeaders.Add("X-Atlassian-Token", "nocheck");
            client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
            MultipartFormDataContent content = new MultipartFormDataContent();

           HttpContent fileContent = new ByteArrayContent(File.ReadAllBytes("z.txt.txt"));
           content.Add(fileContent, "file","z");
             var response = client.PostAsync(postUrl, content).Result;
     
             


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source