Is there a limit of data sent with post queries in c#?

Valbers

Client
Регистрация
27.12.2021
Сообщения
8
Благодарностей
1
Баллы
3
Hi, my post queries sent in c# are not transmitted anymore from a certain amount of data (~ 800 - 1000 words), is there a limit of data sent per query ?

I have no error message from zeno but the requests don't work

It's not a syntax problem, I checked several times and it was a problem of "quantity of data".

I have contacted the api developer and it seems that it's not from the software

Here is my code


C#:
string kw;
string lienInterne;
string folderRootPath = project.Directory.Replace("\\","\\\\");
string listKw = "";
string listLiensInternes ="";
string listLiensImages = "";
string listTitles = "";
string requeteCreerProjet;
string projectId;
string lienImage;
string title;

if (project.Lists["ProjectId"].Count != 0) {
  
    project.Lists["ProjectId"].Clear();
  
}
      
    requeteCreerProjet = ZennoPoster.HttpGet("http://localhost:8008/create/articlecreator", "", "UTF-8");
      
    projectId = Regex.Match(requeteCreerProjet,"(?<=\"id\":\").+?(?=\")").ToString();


for (int i =0; i< project.Lists["motsClesLiens"].Count; i++){      
    kw = project.Lists["motsClesLiens"][i];
    kw = Regex.Replace(kw, "^", "\"");
    kw = Regex.Replace(kw, "$", "\",");
    listKw = Regex.Replace(listKw, "$", kw);
}


for(int i =0; i< project.Lists["liensInternes"].Count; i++){
  
    lienInterne = project.Lists["liensInternes"][i];
    lienInterne = lienInterne.Replace("\"","\\\"");
    lienInterne = Regex.Replace(lienInterne, "^", "\"");
    lienInterne = Regex.Replace(lienInterne, "$", "\",");
    listLiensInternes = Regex.Replace(listLiensInternes, "$",lienInterne);

}


for (int i =0; i< project.Lists["liensImages"].Count; i++){  
  
    lienImage = project.Lists["liensImages"][i];
    lienImage = Regex.Replace(lienImage, "^", "\"");
    lienImage = Regex.Replace(lienImage, "$", "\",");
    listLiensImages = Regex.Replace(listLiensImages, "$",lienImage);
}

for (int i =0; i< project.Lists["motsClesTitles"].Count; i++){  
  
    title = project.Lists["motsClesTitles"][i];
    title = Regex.Replace(title, "^", "\"");
    title = Regex.Replace(title, "$", "\",");
    listTitles = Regex.Replace(listTitles, "$",title);
}


listKw = Regex.Replace(listKw, ",$", "");
listLiensInternes = Regex.Replace(listLiensInternes, ",$", "");
listLiensImages = Regex.Replace(listLiensImages, ",$", "");
listTitles = Regex.Replace(listTitles, ",$", "");

ZennoPoster.HttpPost("http://localhost:8008/project/data/"+projectId,"{\"articleUseCache\":false,\"articleKeywordsFile\":[\"verre paix dieu\"],\"articleTemplateInfo\":{\"name\":\"Base BH\",\"filename\":\"Base BH.user-template.json\"},\"articleCombinationType\":\"one keyword\",\"articleCountType\":\"Required\",\"articleCountRequired\":300,\"articleUseSpinner\":false,\"articleGoogleCountry\":\"France:French:\",\"urlLimitResults\":300,\"articleOutputType\":\"Folder\",\"articleOverwriteOutput\":false,\"articleVariations\":13,\"articleOutputFilenameString\":\"%title%\",\"articleCustomTitlesFile\":[],\"articleScrapedTitlesMinLength\":3,\"articleInsertOptionTitle\":1,\"articleCategories\":[\"Ma catégorie\"],\"articleCustomContent\":{\"5d0e-9a91-9839\":{\"textPosition\":0,\"insertFrom\":1,\"insertTo\":1,\"filepath\":\""+folderRootPath+"\\\\ContenuCustom\\\\baliseCloakingGoogleHaut.txt\"},\"9e0c-96d3-bb20\":{\"textPosition\":2,\"insertFrom\":1,\"insertTo\":1,\"filepath\":\""+folderRootPath+"\\\\ContenuCustom\\\\baliseCloakingGoogleBas.txt\"},\"fd3c-9337-ba5f\":{\"textPosition\":2,\"insertFrom\":1,\"insertTo\":1,\"filepath\":\""+folderRootPath+"\\\\ContenuCustom\\\\baliseCloakingVisiteurHaut.txt\"},\"e59d-8822-a935\":{\"textPosition\":2,\"insertFrom\":1,\"insertTo\":1,\"filepath\":\""+folderRootPath+"\\\\ContenuCustom\\\\baliseCloakingVisiteurBas.txt\"},\"c8aa-865e-8808\":{\"textPosition\":5,\"insertFrom\":16,\"insertTo\":30,\"filepath\":\""+folderRootPath+"\\\\Contenu\\\\ContenuPretAPoster\\\\ressourceSpin.txt\"}},\"paragraphCountFrom\":77,\"paragraphCountTo\":77,\"linkSets\":{\"Links 1\":{\"linkFormatString\":\"&lt;strong&gt;&percnt;url&percnt;&lt;&sol;strong&gt;\",\"insertCount\":20,\"insertCountTo\":40,\"isLinkList\":false,\"linkCodeText\":\"Read more about %link% here.\",\"linkInsertPosition\":1,\"genericAnchorText\":\"\",\"genericAnchorTextPct\":0,\"wordRangeFrom\":2,\"wordRangeTo\":3,\"keywordsFile\":[],\"urlsFile\":["+listKw+"],\"genericAnchorsFile\":[]},\"Links 2\":{\"linkFormatString\":\"&lt;em&gt;&percnt;url&percnt;&lt;&sol;em&gt;\",\"insertCount\":20,\"insertCountTo\":40,\"isLinkList\":false,\"linkCodeText\":\"Read more about %link% here.\",\"linkInsertPosition\":1,\"genericAnchorText\":\"\",\"genericAnchorTextPct\":0,\"wordRangeFrom\":2,\"wordRangeTo\":3,\"keywordsFile\":[],\"urlsFile\":["+listKw+"],\"genericAnchorsFile\":[]},\"Links 3\":{\"linkFormatString\":\"&lt;u&gt;&percnt;url&percnt;&lt;&sol;u&gt;\",\"insertCount\":20,\"insertCountTo\":40,\"isLinkList\":false,\"linkCodeText\":\"Read more about %link% here.\",\"linkInsertPosition\":1,\"genericAnchorText\":\"\",\"genericAnchorTextPct\":0,\"wordRangeFrom\":2,\"wordRangeTo\":3,\"keywordsFile\":[],\"urlsFile\":["+listKw+"],\"genericAnchorsFile\":[]},\"Links 4\":{\"linkFormatString\":\"&percnt;url&percnt;\",\"insertCount\":18,\"insertCountTo\":30,\"isLinkList\":false,\"linkCodeText\":\"Read more about %link% here.\",\"linkInsertPosition\":1,\"genericAnchorText\":\"\",\"genericAnchorTextPct\":0,\"wordRangeFrom\":2,\"wordRangeTo\":3,\"keywordsFile\":[\"\"],\"urlsFile\":["+listLiensInternes+"],\"genericAnchorsFile\":[]},\"Links 5\":{\"linkFormatString\":\"&percnt;url&percnt;\",\"insertCount\":12,\"insertCountTo\":20,\"isLinkList\":false,\"linkCodeText\":\"\",\"linkInsertPosition\":1,\"genericAnchorText\":\"\",\"genericAnchorTextPct\":0,\"wordRangeFrom\":2,\"wordRangeTo\":3,\"keywordsFile\":["+listKw+"],\"urlsFile\":[\"Mon lien externe\"],\"genericAnchorsFile\":[]}},\"articleUseImages\":true,\"articleUseVideos\":false,\"imageInsert\":{\"FloatLeft\":false,\"FloatRight\":false,\"Centre\":true,\"ImageWidth\":1000,\"Source\":2,\"imageCustomImagesFile\":["+listLiensImages+"],\"ImageAltTags\":2,\"imageCustomAltTagsFile\":[],\"InsertAtStartOfBody\":false,\"InsertAtEndOfBody\":false,\"FrequencyFrom\":12,\"FrequencyTo\":20,\"ImageFormatString\":\"<img %float% src=%url% width=%width% alt=%alt%/>\",\"ImageUrls\":[]},\"articleUseHeadings\":true,\"headingInsert\":{\"HeadingTags\":\"h2,h3\",\"FrequencyFrom\":6,\"FrequencyTo\":12,\"InsertOption\":1,\"InsertToc\":\"true\",\"TocHeading\":\"Sommaire\",\"TocStyle\":\"background: #f9f9f9;border: 1px solid #aaa;display: table;margin-bottom: 1em;padding: 1em;width: 100%;\",\"TocTitleStyle\":\"font-weight: 700;text-align: center;\"},\"articleUseList\":true,\"listInsert\":{\"ListStartTag\":\"<ul>\",\"ListEndTag\":\"</ul>\",\"ItemStartTag\":\"<li>\",\"ItemEndTag\":\"</li>\",\"ItemCountFrom\":8,\"ItemCountTo\":12,\"InsertChance\":100},\"jobName\":\"Nom de la tache\",\"groupName\":\"\",\"jobOutputFolder\":\""+folderRootPath+"\\\\Contenu\\\\ContenuPretAPoster\",\"jobCron\":\"\"}", "application/json", "", "UTF-8");
When I load too much my "listInternalLinks" or "listKw" lists it doesn't work anymore
 

nicanil

Client
Регистрация
06.03.2016
Сообщения
2 242
Благодарностей
1 820
Баллы
113
Hi.
  • What response do you get?
    • Status code?
  • As I can see you send requests to the localhost server. Did you check server logs? Is there any error?
  • Check traffic window also.
I think that the problem might be in the request body, maybe there are some inappropriate characters.
 

Valbers

Client
Регистрация
27.12.2021
Сообщения
8
Благодарностей
1
Баллы
3
I get the answer "413 Payload Too Large".

So it's not coming from the request sent I also tested in python and I have the same problem

maybe a limit of sent data is set on the local server i will check that
 
  • Спасибо
Реакции: nicanil

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)