cURL in POST or GET Node

Hey!

I am trying to connect to the weather.gov (https://www.weather.gov/documentation/services-web-api#/default/get_alerts) API and the configuration instructions show it in cURL format. I am trying to understand how the code for the the cURL translates into successful configuration for the POST or GET nodes.

For example this is what it shows:

> Curl: curl -X GET "https://api.weather.gov/zones?id=&area=CO&type=land&include_geometry=true" -H "accept: application/geo+json"

> Request URL: https://api.weather.gov/zones?id=&area=CO&type=land&include_geometry=true

I have tried configuring the POST node with the URL. But I don’t get a good return.


Additionally, I am trying to access the ncdc.noaa.gov API with my Token, but it follows the same cURL format, so I am running into similar issues.

I really appreciate any thoughts/suggestions you might have!

Hi,
From the curl command it seems like you have to use the GET Request node instead.
Kind regards
Alexander

Hi @AlexanderFillbrunn,

I ran the GET node with the URL and the ‘accept’ request header but it returned this:

Hi TardisPilot,

I could successfully access the API using the HTTP Retriever node. You can just input the given URL https://api.weather.gov/zones?area=CO&type=land&include_geometry=true into the HTTP Retriever node, no need to escape anything. The accept header is not strictly necessary, it’ll send JSON per default (for APIs which require a specific header, you can use the “Headers” tab of the node).

Check here for a working example workflow:

Cheers,
P.

7 Likes

@qqilihq
Perfect! Thank you!

2 Likes

if you paste your link into a browser it will show you the error. Your link is faulty with the empty id parameter just remove that like qqlihq did then the GET node works just fine.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.