Skip to main content
1-Visitor
August 24, 2021
Question

PostMultipart : have problem as there's chinese character in partsToSend

  • August 24, 2021
  • 1 reply
  • 1970 views

Hello, recently I use PostMultipart, and these's chinese character in my partsToSend
so I set the headers like this:

 

 

 

 

var params = {
proxyScheme: undefined /* STRING */,
headers: {"Content-type":"multipart/form-data; charset=UTF-8"} /* JSON */,
ignoreSSLErrors: undefined /* BOOLEAN */,
useNTLM: undefined /* BOOLEAN */,
partsToSend: formData /* INFOTABLE */,
workstation: undefined /* STRING */,
useProxy: undefined /* BOOLEAN */,
repository: undefined /* STRING */,
proxyHost: undefined /* STRING */,
url: url /* STRING */,
};

// result: JSON
var result = Resources["ContentLoaderFunctions"].PostMultipart(params);

 

 

 

 


Here I print out the content which api server received:

Red: If I remove the content of headers, every chinese character  will become to "?"
Orange: There's no problem as I use Postman to test the api

Green: the content which api server received will become to nothing as setting the headers

RC_8716579_0-1629812654251.png

I also try to set headers: {"Content-type":"charset=Big5"} but the result is the same as UTF-8


anyone can help me?
thanks a lot!

1 reply

Support
August 26, 2021

Hi @RC_8716579 

 

What version of ThingWorx are you running?  Can you provide more detail around your use case?  What are you sending it to?

 

Regards.

 

--Sharon

 

1-Visitor
September 5, 2021

The version of Thingworx is 8.4.

In the detail, I write the RESTful API by golang and test it by postman, it seems work normally.
And I want Thingworx to get the data from the API by POST method.

Is it not ok to use form-data ?