cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmgrdg
Frequent Visitor

Post Request advanced editor

Hello I want to connect to data on my webservice

h**p://*****.com/provision/user/user_login.h*ml

 

I need parameters in the body clause: user, password, clientId

 

I wrote this c# code in postman:

 

var client = new RestClient("h**p://******.com/provision/user....ht ml");
var request = new RestRequest(Method.POST);
request.AddHeader("Postman-Token", "c153f34d-5c8b-46dd-b9e7-7901aa6e62fc");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
request.AddParameter("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"user\"\r\n\r\nUSER\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nPASSWORD\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"clientId\"\r\n\r\nCLIENTID\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

 

But i didnt know how to use it in the power query editor. Some code example to transform my code?

Thanks a lot

4 REPLIES 4
jmgrdg
Frequent Visitor

Hello I want to connect to website

https://*****.com/provision/user/user_login.html

 

I need parameters in the body clause: user, password, clientId

 

I wrote this c# code in postman:

 

var client = new RestClient("https://************.com/provision/user/user_login.html");
var request = new RestRequest(Method.POST);
request.AddHeader("Postman-Token", "c153f34d-5c8b-46dd-b9e7-7901aa6e62fc");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
request.AddParameter("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"user\"\r\n\r\nUSER\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nPASSWORD\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"clientId\"\r\n\r\nCLIENTID\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

 

But i didnt know how to use it in the power query editor. Some code example to transform my code?

Thanks a lot.

jmgrdg
Frequent Visitor

Hello I want to connect to website

https://*****.com/provision/user/user_login.html

 

I need parameters in the body clause: user, password, clientId

 

I wrote this c# code in postman:

 

var client = new RestClient("https://ws.xxx.com/provision/user/user_login.html");
var request = new RestRequest(Method.POST);
request.AddHeader("Postman-Token", "c153f34d-5c8b-46dd-b9e7-7901aa6e62fc");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
request.AddParameter("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"user\"\r\n\r\nUSER\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nPASSWORD\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"clientId\"\r\n\r\nCLIENTID\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

 

But i didnt know how to use it in the power query editor. Some code example to transform my code?

Thanks a lot.

jmgrdg
Frequent Visitor

Hello I want to connect to data on my webservice

 

I need parameters in the body clause: user, password, clientId

 

I wrote this c# code in postman:

 

var client = new RestClient("h**p://******.c*m/provision/user....htm*");
var request = new RestRequest(Method.POST);
request.AddHeader("Postman-Token", "c153f34d-5c8b-46dd-b9e7-7901aa6e62fc");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
request.AddParameter("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"user\"\r\n\r\nUSER\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nPASSWORD\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"clientId\"\r\n\r\nCLIENTID\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

 

But i didnt know how to use it in the power query editor. Some code example to transform my code?

Thanks a lot

v-juanli-msft
Community Support
Community Support

Hi @jmgrdg

What kind webservice is your link?

"h**p://*****.com/provision/user/user_login.h*ml"

 

When you use Postman, i would suggest you refer to this thread.

https://community.powerbi.com/t5/Developer/Power-BI-REST-API-using-postman-generate-embed-token/td-p...

 

Best Regards

Maggie

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors