Forum Discussion

shadab1312's avatar
shadab1312
New Contributor
4 years ago

POST request data is getting truncated and error Content is not allowed in prolog shown

I am trying to a POST request with data which is in Base64 encoded format.
When sending the request, I see that the actual data which is sent by Ready api has been truncated(see the attached screenshot).

In the Outline tab, I see below error:
org.apache.xmlbeans.xmlexception: error: Content is not allowed in prolog

 

I am not using any other attachment. I am no sure what is wrong here with the test data. Anyone has experience with such issue?

  • I tried another thing:

     

    I used the request content as parameter and checked Post QueryString option(See screenshot). 

     

    Now it works!!!

  • richie's avatar
    richie
    Community Hero
    Hey shadab1312,

    That xmlprolog error's like a catch all xml parser error....really not helpful when trying to diagnose what went wrong.

    I suspect that the base64 encode value is larger than what is accepted by the defaults in readyapi.

    The way to prove this would be if you submit your request with a base64 encoded value that is a lot smaller than what you tried. I appreciate your endpoint might be expecting a certain length value so youll probably get a 400 or 422 or some other client error if you submitted a base64 value a lot smaller than what you need, but try it.....this will prove if the issue is because the base64 encode value is too large.

    Might help if you can you post your headers on the request and response please?

    Im on my phone at the moment, but i remember theres a setting in the preferences for chunking/payload size. Id tweak those settings to try and fix this if i were you.

    Nice one,

    Rich
    • shadab1312's avatar
      shadab1312
      New Contributor

      Hi Richie,

       

      Thanks for your response.

      As you suggested I tried below things:

      1. Sent request with much smaller content with a base64 encoded value. => Result: Still the POST request data is getting truncated.

      2. Changed Preferences settings (see screenshot attached). => Result: Still the POST request data is getting truncated.

      Is there any other setting in Ready API that could have impact? 

       

      Also, I have attached the screenshot of headers.

       

      Regards,

      Shadab

    • shadab1312's avatar
      shadab1312
      New Contributor

      I tried another thing:

       

      I used the request content as parameter and checked Post QueryString option(See screenshot). 

       

      Now it works!!!

      • richie's avatar
        richie
        Community Hero

        shadab1312 

         

        holdit - you had a very large base64 encoded value in a tag and then you posted it as a query parm instead?

         

        Surprised that worked with the length of the base64 value - it looked like it was close to the URL char limit - but it from what you've explained, it sounds like your endpoint would only allow types of multiform-urlencoded rather than application/xml to begin with....

         

        glad you sorted!

         

        Rich