I want to send a jpeg image converted to base64 by json. The image is about 660kb in size and the characters after the conversion are approximately 2 million in length. What I need is to send it to a api ?? in a query string, if possible.
The error I get is that the string is too long. Are there any alternatives?
HttpClient client = new HttpClient();
string uploadJson = "http://mylink/WebApi/api/uploadPhoto?jsonImage=" + jsonImage + "&IdOdl=" + IdOdl + "&SnDevice=" + SnDevice + "&cod=" + cod + "&IdTechnician=" + IdTechnician + "&id_producer=" + id_producer + "&pdr=" + pdr;
client.BaseAddress = new Uri(uploadJson);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Task<HttpResponseMessage> response = client.GetAsync(uploadJson);
HttpResponseMessage res = response.Result;
if (!res.IsSuccessStatusCode)
{
Console.Write("Error upload");
}