We have answer of your question!

100% solved queries, no empty question

Question: Json file request produce "(413) Request Entity Too Large"。


0

Advertisement


I have a json file more than 10,000 rows

so when I request to Power BI

I'll get a error message

(413) Request Entity Too Large。

if the Json file < 10,000 rows this code is can work

so how I can fix this problem about the rows too mush

this is my code

string ColumnValuesJson = System.IO.File.ReadAllText(@"PowerBI_Column_Values.json");

//POST web request
byte[] byteArray = System.Text.Encoding.UTF8.GetBytes(ColumnValuesJson);

request.ContentLength = byteArray.Length;

Console.WriteLine(byteArray.Length);
Console.ReadLine();
//
using (Stream writer = request.GetRequestStream())
{
    writer.Write(byteArray, 0, byteArray.Length);
    var response = (HttpWebResponse)request.GetResponse();

    /*Time*/
    ProcessTime.Stop();
    Console.WriteLine("20,000 Rows  {0} ms", ProcessTime.ElapsedMilliseconds);
    Console.ReadLine();
}
Question author Minghong-zheng | Source

Answer


1


Advertisement


413 errors occur when the request body is larger than the server is configured to allow. Here’s how you can fix it, depending on your web server (and if you have access to it):

If your not the owner of the server you could either try uploading a smaller compressed file or sending the request with an multipart/form-data Content-Type. Here are some examples how to do it.

As concluded in the comments you want to call the AddRows method on the Power BI REST API. In the limitations is mentioned that that only 10'000 rows can be added per request. The easyiest thing to do would be parsing the json file to an array and send mutiple requests. To parse JSON in c# you can take a look at this article

Answer author Dr-fre

Advertisement


Tickanswer.com is providing the only single recommended solution of the question Json file request produce "(413) Request Entity Too Large"。 under the categories i.e c# , .net , json , webserver , powerbi , . Our team of experts filter the best solution for you.

Related Search Queries:

413 request entity too large c# ,

You may also add your answer!