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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Convert Curl to Web.Contents in Power Query

Hi, 
I need help converting curl into Power Query. Now I have curl expression that works (tested in Postman) but I can't make it  work in Power Query. I'm doing auth by ApiKey named x-fireeye-api-key. APIKeyName needs to be passed through header. So far I tried through Web.Contents. Advice pls, need push to right direction. Thanks in advance

 

 

 

curl -k "https://hexsks639-hx-webui-1.hex03.helix.apps.fireeye.com/hx/api/v3/token" -X "http://gate.zrh.XXX.com:8080" -X "GET" -H "Accept: application/json" -H "x-fireeye-api-key:XYZ" -i

 

 

 

 

Annotation 2022-08-15 170024.png

What I have so far

 

 

 

 

let
GetAPIKeyName = "x-fireeye-api-key",
HttpRequest = [#"RelativePath" = "hx/api/v3/token", #"ApiKeyName" = GetAPIKeyName, Headers = [#"Accept" = "application/json"]],
Result = Json.Document(Web.Contents("https://gate.zrh.XXX.com:8080/hexsks639-hx-webui-1.hex03.helix.apps.fireeye.com/", HttpRequest ))
in Result

 

 

 

 

 

4 REPLIES 4
lbendlin
Super User
Super User

HttpRequest = [RelativePath = "hx/api/v3/token", ApiKeyName = GetAPIKeyName, Headers = [Accept = "application/json"]],

 

Web.Contents - PowerQuery M | Microsoft Docs

Anonymous
Not applicable

Yes, I tried that one also but it looks that problem is in passing 

"http://gate.zrh.XXX.com:8080"

through Web.Contents function. 

Web.Contents does not handle redirects very well. Have a look at Web.BrowserContents.

Anonymous
Not applicable

Yes, that will not work for what I have. Thanks for trying to help

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.