Forum Discussion
Try to convert curl into powerquery
- 1 year ago
Ok it good to know I need to specify a payload, but don't know how to apply, I read the website but do not find the info how to apply payload
I try to appy this
let
url = ...,
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([x = 235.7, y = 41.53]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponselet
url = "https://my website:3129/v1/blocklist",
headers = [#"X-APIKey" ="my key",
#"Content-Type"="application/json"],
postData = Json.FromValue([""]),
response = Web.Contents(
url,
[ Headers = headers
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
Ok it good to know I need to specify a payload, but don't know how to apply, I read the website but do not find the info how to apply payload
I try to appy this
let
url = ...,
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([x = 235.7, y = 41.53]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
let
url = "https://my website:3129/v1/blocklist",
headers = [#"X-APIKey" ="my key",
#"Content-Type"="application/json"],
postData = Json.FromValue([""]),
response = Web.Contents(
url,
[ Headers = headers
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
- lbendlin1 year agoSuper User
Did it work?
Try
postData = Json.FromValue([x=0]),