duandang9434 2016-09-12 13:20
浏览 118

Mule HTTP请求:错误查询参数与大字符串

I am calling the REST (PHP) from Mule HTTP Request using query-param.

This works fine, with small params data!

But one of the params ("rest_data") is a content file (Base64 encoded). When the file content is large (> ~8K) the request faild. I think that params does not support large strings.

What should be the way to use body instead query-param on Mule in this case?

See the configuration file:

   <http:request-config name="HTTP_Request_Configuration" host="164.164.164.233" port="80" basePath="/crmtec/service/v4_1/rest.php" doc:name="HTTP Request Configuration">
    </http:request-config>
    <http:request config-ref="HTTP_Request_Configuration" path="/" method="POST" doc:name="HTTP Documento">
        <http:request-builder>
            <http:query-param paramName="method" value="set_document_revisions"/>
            <http:query-param paramName="input_type" value="JSON"/>
            <http:query-param paramName="response_type" value="JSON"/>
            <http:query-param paramName="rest_data" value="#[flowVars.params.rest_data]"/>
        </http:request-builder>
        <http:success-status-code-validator values="0..599"/>
    </http:request>
  • 写回答

4条回答 默认 最新

  • dongzhuo5185 2016-09-12 14:23
    关注

    Whatever is in the payload will be send in the body of the HTTP request, so you should add that rest_data to the payload with a set-payload component before the http:request component:

    <set-payload value="#[flowVars.params.rest_data**]"/>

    It's not a good practice to use query params for large data, that's why it fails.

    评论

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配