执行python脚本时出现“超出表格值计数限制1024”错误

时间:2019-03-18 09:34:28

标签: asp.net-core python-requests

运行脚本时出现以下错误。我不确定为什么会收到此错误。谁能帮我吗?

脚本:

import requests
import json

url = "http://snlwebtool6/SPGMI.Services.Extraction.Service/v1/extraction"
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
keys = {
    'AddMemorandaTable':'false', 
    'AllowNonSeparatedNumbers': 'false', 
    'CultureName': 'en-US', 
    'DefaultCurrency': 'USD',
    'DefaultLanguage': 'en', 
    'UseExtractionStrategies': 'true',
    'ExtractionPlanName': 'InsuranceSolvencyExtractionPlan'
}
files = open(r"C:\Users\klanka\Documents\391648896.pdf", encoding="Latin-1")
indata= {'extractionSettings': keys,'filetoExtract': files}
r = requests.post(url, headers=headers, data=indata)

print(r.json())

完整错误:

  

'message':'超出了表格值计数限制1024。','stackTrace':'在Microsoft.AspNetCore.WebUtilities.FormReader.Append(KeyValueAccumulator&accumulator)\ r \ n在Microsoft.AspNetCore.WebUtilities.FormReader。{ {1}} d__43.MoveNext()\ r \ n ---从上一个引发异常的位置开始的堆栈结束跟踪--- \ r \ n位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\ r \ n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)\ r \ n在System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(任务任务)\ r \ n在Microsoft.AspNetCore.Http.Features.FormFeature。{ {1}} d__18.MoveNext()\ r \ n ---从上一个引发异常的位置开始的堆栈结束跟踪--- \ r \ n位于System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\ r \ n,位于System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)\ r \ n,位于Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()\ r \ na t Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest.get_Form()\ r \ n位于lambda_method(Closure,Object,Object [])\ r \ n位于Extraction.Service.Controllers.ExtractionController.Post()\ r \ n Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker上的Microsoft.AspNetCore.Mvc.Internal.ObjectMethodExecutor.Execute {Object target,Object []参数)\ r \ n。<ReadFormAsync> d__27.MoveNext()\ r \ n- -从之前抛出异常的位置开始的堆栈末尾跟踪--- \ r \ n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\ r \ n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task任务)\ r \ n,位于Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker。<InnerReadFormAsync> d__25.MoveNext()\ r \ n ---从上一个引发异常的位置开始的堆栈结束跟踪--- \ r \ n在Microsoft.AspNetCore.Mvc.Internal.ControllerActionActionInvoker.Rethrow(ActionExecutedContext上下文)\ r \ n在Microsoft.AspNetCore.Mvc.Internal.ControllerActionActionInvoker.Next(S tate&next,Scope&scope,Object&state,Boolean&isCompleted)\ r \ n,位于Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker。<InvokeActionMethodAsync> d__24.MoveNext()','type':'System.IO.InvalidDataException' ,“ statusCode”:500,“ data”:{},“ innerError”:无}

0 个答案:

没有答案