Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

API call with form params

Hi,

 

As per my understanding the below code :

Source = Json.Document(Web.Contents(url,[Content = [search = search,exec_mode=exec_mode,output_mode=output_mode,offset=offset,count=count]]))

will add query params to the url

How to send form params in the POST??? (equialent of -d in curl)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

https://stackoverflow.com/questions/50151940/power-query-make-http-post-request-with-form-data

 

worked

 

let
    url = "https://example.com",
    body  = "{ ""first_param"": ""AAAAA"",  ""second_param"": ""BBBBBB""}",
    Parsed_JSON = Json.Document(body),
    BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
    Source = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(BuildQueryString) ] ))
in
    Source

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

https://stackoverflow.com/questions/50151940/power-query-make-http-post-request-with-form-data

 

worked

 

let
    url = "https://example.com",
    body  = "{ ""first_param"": ""AAAAA"",  ""second_param"": ""BBBBBB""}",
    Parsed_JSON = Json.Document(body),
    BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
    Source = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(BuildQueryString) ] ))
in
    Source

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors