I’m building a .NET tool to retrieve Jira project tickets but get 404/empty responses. Below is an alternative API call snippet for clarity:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(jiraServer + "/rest/api/latest/search");
req.Method = "GET";
req.Accept = "application/json";
req.Headers.Add("Authorization", "Basic " + EncodeCredentials("demoUser", "demoToken"));
using(HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
{
using(StreamReader reader = new StreamReader(resp.GetResponseStream()))
{
string jsonResult = reader.ReadToEnd();
}
}
hey, check your endpoint and trailing slash. i had a simlar issue - sometimes a minor url typo and token misencoding lead to 404 errors. hope this helps!
I had a similar experience where the unexpected 404 was caused by using an API endpoint that did not match my server’s configuration. I initially thought it was an authentication issue until I examined the API version in the URL. In my case, using “/rest/api/latest/search” worked inconsistently because the server expected a specific version identifier. Besides verifying the URL and endpoint version, thoroughly checking the headers and proper encoding of credentials saved a lot of debugging time. This approach helped me resolve the issue and retrieve the correct data.