Test Data Manager

 View Only
  • 1.  Use APIs to Generate Test Data (Docker)

    Posted Aug 28, 2019 11:37 AM
    Hi

    • Running docker containers (using official oracle database), and trying to generate Test Data by sending API's on my localhost.
    • Able to successfully send request via POSTMAN to
      • generate security token
      • create connection profile
      • create project and version
      • create data generator
    But when tried to "Register a File Object", got "Unsupported media type" error. 

    Thanks
    Amanpreet Aulakh


  • 2.  RE: Use APIs to Generate Test Data (Docker)

    Broadcom Employee
    Posted Aug 29, 2019 03:41 AM
    First, this has nothing to do with the use of a docker container

     "Unsupported media type" error message is generated because type=application/json  is missing.

    Here is an example using curl for uploading a csv file
    curl -X POST 
    --header 'Content-Type: multipart/form-data' 
    --header 'Accept: application/json' 
    --header 'Authorization: Bearer <some token>' 
    -F body={\"objectType\":\"CSV\",\"headerAt\":1,\"dataStartsAt\":2,\"tableNames\":[]};type=application/json 
    -F files=Sample.csv

    I have added header 'Content-Type: multipart/form-data' as postman might not add it automatically (Curl does).

    Regards, Dahman





  • 3.  RE: Use APIs to Generate Test Data (Docker)

    Posted Aug 29, 2019 09:58 AM
    • I performed the same steps earlier, as recommended.
    • Have attached screenshots for reference



  • 4.  RE: Use APIs to Generate Test Data (Docker)

    Broadcom Employee
    Posted Aug 30, 2019 03:53 AM
    See screenshot. you are missing the content type in the body

    image.png

    Regards, Dahman





  • 5.  RE: Use APIs to Generate Test Data (Docker)
    Best Answer

    Broadcom Employee
    Posted Aug 30, 2019 04:43 AM
    Edited by Christopher Hackett Sep 05, 2019 03:40 PM
    Hi,

         Can you change the Key name from files to file, and as Dahman mentioned change the content type for the body key to be  application/json
      


    ------------------------------
    Regards

    Keith Puzey
    Client Services Consultant | Enterprise Software Division
    Broadcom
    ------------------------------



  • 6.  RE: Use APIs to Generate Test Data (Docker)

    Posted Aug 30, 2019 09:22 AM
      |   view attached
    Hi

    • Tested with and without content-type, it was giving error
    • When changed the name "files" > "file", now running successfully (used "files" as mentioned in swagger).
    Thanks, it helped.

    Amanpreet Aulakh