cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

REST call: Error while using x-www-form-urlencoded authentication

0 Kudos

REST call: Error while using x-www-form-urlencoded authentication

Hi ,

 

I am trying to call rest api which is using request as "x-www-form-urlencoded", I am using thingworx PostText Service but everytime getting Below error whereas I have passed username and password.

result
{"error":"Argument \u0022username\u0022 is required."}

 

Below is the code : I have made username,password, and url hidden in below code

var params = {
proxyScheme: undefined /* STRING */,
headers: undefined /* JSON */,
ignoreSSLErrors: false /* BOOLEAN */,
useNTLM: undefined /* BOOLEAN */,
workstation: undefined /* STRING */,
useProxy: undefined /* BOOLEAN */,
withCookies: undefined /* BOOLEAN */,
proxyHost: undefined /* STRING */,
url: "https://" /* STRING */,
content: "" /* STRING */,
timeout: undefined /* NUMBER */,
proxyPort: undefined /* INTEGER */,
password: "abc" /* STRING */,
domain: undefined /* STRING */,
contentType: "application/x-www-form-urlencoded" /* STRING */,
username: "xyz" /* STRING */
};

// result: STRING
var result = Resources["ContentLoaderFunctions"].PostText(params);

 

Output:

result
{"error":"Argument \u0022username\u0022 is required."}

 

 

Any kind of help would be highly helpful for me.

Waiting for your response.

Thanks In Advance.

1 Comment
olivierlp
Community Manager
Status changed to: No Plans to Implement

Thank you. But no plans to implement at this time.