<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get Request, how to use form-data with GET Request in the Thingworx in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803290#M58628</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;Trying to do the Get Request with the Form Data but that is not working in the TWX. But in the PostMan, it gives me an 200 Ok Response.&lt;BR /&gt;&lt;BR /&gt;Postman Form-Data:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="psp316r_0-1655920050769.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/59139iAA455D4F3E9155E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="psp316r_0-1655920050769.png" alt="psp316r_0-1655920050769.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How this Form data can be used in the Get Request in Thingworx Service.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/183931"&gt;@slangley&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shashi.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2022 17:48:50 GMT</pubDate>
    <dc:creator>pshashipreetham</dc:creator>
    <dc:date>2022-06-22T17:48:50Z</dc:date>
    <item>
      <title>Get Request, how to use form-data with GET Request in the Thingworx</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803290#M58628</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;Trying to do the Get Request with the Form Data but that is not working in the TWX. But in the PostMan, it gives me an 200 Ok Response.&lt;BR /&gt;&lt;BR /&gt;Postman Form-Data:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="psp316r_0-1655920050769.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/59139iAA455D4F3E9155E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="psp316r_0-1655920050769.png" alt="psp316r_0-1655920050769.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How this Form data can be used in the Get Request in Thingworx Service.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/183931"&gt;@slangley&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shashi.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 17:48:50 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803290#M58628</guid>
      <dc:creator>pshashipreetham</dc:creator>
      <dc:date>2022-06-22T17:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get Request, how to use form-data with GET Request in the Thingworx</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803304#M58629</link>
      <description>&lt;P&gt;&amp;nbsp;This is Thingworx Service Code, But doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;var table = Resources["InfoTableFunctions"].CreateInfoTable();
table.AddField({name: "form-data", baseType: "JSON"});
table.AddRow({
        "form-data" : 
        {
            grant_type : "*********",
            client_id : "*********"",
            client_secret : "*********"",
            resource : "*********""   
        }
});

let params = {
	proxyScheme: "https" /* STRING {"defaultValue":"http"} */,
	headers: {"Content-Type" : "multipart/form-data", "Accept": "*/*"} /* JSON */,
	ignoreSSLErrors: undefined /* BOOLEAN */,
	useNTLM: undefined /* BOOLEAN {"defaultValue":false} */,
	partsToSend: table /* INFOTABLE */,
	workstation: undefined /* STRING {"defaultValue":""} */,
	useProxy: undefined /* BOOLEAN {"defaultValue":false} */,
	repository: undefined /* STRING */,
	proxyHost: undefined /* STRING {"defaultValue":""} */,
	url: "*********"" /* STRING */,
	timeout: undefined /* NUMBER {"defaultValue":60} */,
	proxyPort: undefined /* INTEGER {"defaultValue":8080} */,
	password: undefined /* STRING */,
	pathOnRepository: undefined /* STRING */,
	domain: undefined /* STRING {"defaultValue":""} */,
	username: undefined /* STRING */
};

// result: JSON
let result = Resources["ContentLoaderFunctions"].PostMultipart(params);

&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Jun 2022 19:04:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803304#M58629</guid>
      <dc:creator>pshashipreetham</dc:creator>
      <dc:date>2022-06-22T19:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get Request, how to use form-data with GET Request in the Thingworx</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803468#M58637</link>
      <description>&lt;P&gt;This is fixed by following code&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;var TableData = me.GetDataTableEntries({
    maxItems: undefined /* NUMBER {"defaultValue":500} */
});

var content = "grant_type=" + TableData.grant_type + "&amp;amp;client_id=" + TableData.client_id + "&amp;amp;client_secret=" + TableData.client_secret;

params = {
    proxyScheme: "https" /* STRING {"defaultValue":"http"} */ ,
    url: "https://***********" /* STRING */ ,
    content: content /* STRING */ ,
    contentType: "application/x-www-form-urlencoded" /* STRING */ ,
};

// response : STRING
response = Resources["ContentLoaderFunctions"].PostText(params);
result = JSON.parse(response);&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Jun 2022 11:09:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Get-Request-how-to-use-form-data-with-GET-Request-in-the/m-p/803468#M58637</guid>
      <dc:creator>pshashipreetham</dc:creator>
      <dc:date>2022-06-23T11:09:03Z</dc:date>
    </item>
  </channel>
</rss>

