5 Replies Latest reply on Mar 30, 2017 8:59 AM by jsanchis RSS
    ss Explorer

    Upload file to ThingWorx cloud from REST URL

    Hi Team,

    Basically I have created a file upload widget (mashup) which uploads the file to my thingWorx cloud instance manually(click on browse->upload) and it was a success.

    Now I wanted to automate the  activity from REST Client like postman.

    If my URL is http://gexxxx.cloud.thingworx.com/Thingworx/FileRepositories/getFileUploadThing/- I tried to post the file ( with headers as appKey - "my application key")

    In body selected binary - and browsed the file to upload and hit send in postman

    I recieved the error response.




            <title>Apache Tomcat/7.0.52 - Error report</title>


                <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-->




            <h1>HTTP Status 500 - Content type may not be null</h1>

            <HR size="1" noshade="noshade">


                <b>type</b> Status report




                <u>Content type may not be null</u>




                <u>The server encountered an internal error that prevented it from fulfilling this request.</u>


            <HR size="1" noshade="noshade">

            <h3>Apache Tomcat/7.0.52</h3>




    However I were able to successfully download the file from REST with GET method and later created a java application to download the file.


    I am stuck with steps to upload file to cloud using rest.