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

Get Fabric certified for FREE! Don't miss your chance! Learn more

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
amitchandak
Super User
Super User

@Anonymous , refer if this can help

https://community.powerbi.com/t5/Desktop/Pull-data-from-API-using-POST-method-in-Power-BI/td-p/574727

https://community.powerbi.com/t5/Desktop/How-to-run-POST-request-in-M/td-p/457138

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.