I'm trying to send a pretty big string (about 3 milion and a half characters) using ajax. The code works fine with small strings but if I try to use the string I need to pass it won't work. The string I use is an encoded base64 Excel file.
This is the code I use to send the string:
$.ajax({
url: "", //The page I call
type: "GET",
data: { base64: "....."},//here goes the string I need to pass
dataType: 'text',
success: function (response) {
alert("successful");
},
error: function () {
alert("error");
}
});
This code works with smaller strings but not with mine. Again the string I'm trying to pass is about 3 milion and a half characters and could even be bigger.
The backend code is the following:
[HttpGet("Test")]
public async Task<string> testHelloWorld(string saluto)
{
try
{
string testString = "Funziona";
Console.Write(testString + ": " + saluto + "\n");
return testString;
}
catch (Exception ex)
{
Log.Error("API(Test) - Exception", ex);
return null;
}
}
Is there a way to send this string??