Forum Discussion

edavidramos's avatar
edavidramos
Occasional Visitor
5 years ago

File appears to get truncated when Posting/Upload using ReadyAPI

Hello,

I have an inconvenince that I am trying to resolve.

 

I am tryin to configure ReadyAPI 3.1.0 to use a specific Rest service with a POST method that is used to Upload files. From the documentation, I assume I configured the API correctly in Ready API. But when I run the commend to upload, the file size does not match and appears to get truncated. This makes the file unusable.

 

I tried to use the example in the Oracle site to use Postman and that works fine. I can upload the file and it looks good. Oracle said it's Ready API problem so here I am asking you all...

 

Ready API 3.1.0 configuration for this:

 

Method: POST

Request Media Type: application/octet-stream

Request Attachments:

 

Response:

 

HTTP/1.1 200 OK
Date: Wed, 12 Feb 2020 22:48:00 GMT
Server: Oracle-Application-Server
P3P: X-CONTENT-TYPE-OPTIONS:nosniff
X-EPM_FUNCTION: EPM Automate
X-EPM_OBJECT: isFirst=true,chunkSize=5000000,isLast=true,File Name=pbcs_delete.csv
X-EPM_ACTION: Upload File
Vary: Accept-Encoding,User-Agent
HttpOnly;HttpOnly;Secure
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json; charset=UTF-8
Content-Language: en
Strict-Transport-Security: max-age=31536000 ; includeSubDomains

{"status":0,"details":null,"links":[{"data":null,"action":"POST","rel":"self","href":"https://pbcs.us2.oraclecloud.com:443/interop/rest/11.1.2.3.600/applicationsnapshots/pbcs_delete.csv/contents"}]}

 

There is an exampl here using Postman and I use that no issue.

https://docs.oracle.com/en/cloud/saas/enterprise-performance-management-common/prest/upload.html

 

 

 

 

  • richie's avatar
    richie
    Community Hero
    Hi edavidramos,

    The headers of your request appear to indicate youre using the application/octet-stream Content-Type header.
    This type is typically used for binary files.
    What is the file type of the file you are publishing in your Post request?

    It would help to have a bit more info relative to the content/payload and headers of the request. All you need to do is strip the security detail from it (auth details, servername in URL and anything relevant in your payload), but at first glance id look at the Content-Type of the.request

    Cheers,

    Rich
    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you richie and nmrao!

       

      edavidramos were you able to solve the issue? Please share if the suggestions helped.