TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Oyedepo Olufemi
1.4k
334
29.6k
Request URI is too long
May 30 2019 6:54 PM
I'm trying to post a Base64 string to the backend for save operation.
It works for smaller base64 strings, but for large files with longer base64, i get a 'Request URI is too long'
here's my code:
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(currentEnvironment);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
var objToSave = new FileUploadForSave();
objToSave.FirstFileBase64 = fileUploadPayload.FirstFileBase64;
objToSave.FirstFileName = fileUploadPayload.FirstFileName;
objToSave.FirstFileExtension = fileUploadPayload.FirstFileExtension;
objToSave.PointSourceAppRegRecId = fileUploadPayload.PointSourceAppRegRecId;
HttpResponseMessage responseMessage = client.PostAsJsonAsync(endpoint, objToSave).Result;
if (responseMessage.IsSuccessStatusCode)
{
return responseMessage.Content.ReadAsAsync<FileUploadResponse>().Result;
}
Reply
Answers (
1
)
How to display report quarterwise in asp.net
Crystal Report Default Images Not visible in the web page