I'm currently developing an android application that takes in a file and converts it into a string. The string is then sent over to a server and I'm using a MVC application in this case. The string has to be sent to a server first because I needed to do some processing before storing it. Below is my code for the MVC application.
[HttpPost]
public HttpResponseMessage RetrieveFile(String fileString)
{
var response = new HttpResponseMessage()
{
Content = new StringContent("{\"File\":\"" + fileString + "\"}")
};
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
return response;
}
However, whenever I call the http://localhost/api/TestCon/RetrieveFile?fileString=*Very Long String*
. it throws a "Request URL Too Long" error message. What do I have to do to send a large about of data, possibly a few MBs, over to the server?