Replies: 3 comments 10 replies
-
Maybe you aren't setting the User-Agent header field? If you could post the significantly different data you get, someone might be able to figure it out. |
Beta Was this translation helpful? Give feedback.
5 replies
-
It appears its being cached at the edge server with the request, differ the user-agent or add a query string param t={epoch}. The user agent difference is most likely why you are seeing differences from PostMan and your code, however, you should try the query string option first.
From: pshijie ***@***.***>
Sent: Friday, June 6, 2025 6:31 AM
To: weather-gov/api ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [weather-gov/api] Issue with Inconsistent Responses from API (Discussion #824)
I'm experiencing inconsistent responses when calling the Weather.gov API endpoint https://api.weather.gov/gridpoints/LOX/160,43/forecast/hourly from my Java application compared to Postman requests.
When I make a request using Postman, I receive the expected weather forecast data. However, when I call the same endpoint with identical parameters from my Java application, the response differs significantly.
Here's the code I'm using to make the API request:
HttpResponse response = HttpRequest.get(url)
.timeout(5000)
.header("Accept", "application/json")
.execute();
I've already tried:
* Adding cache control headers to prevent caching
* Verifying the status code is 200 for both requests
Is there any known issue with the API that could cause different responses based on the client making the request? Are there specific headers or parameters required when accessing the API programmatically that might not be needed when using Postman?
Any guidance on how to ensure consistent responses between Postman and programmatic API calls would be greatly appreciated.
Thank you!
—
Reply to this email directly, view it on GitHub<#824>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADJHCGY7W7HRHEDQGIT3ZGD3CGJYRAVCNFSM6AAAAAB6YCTR7WVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZYGQZDIOJTGY>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
2 replies
-
I'm now consistently seeing an older forecast pulled from my server vs. what I get at home on my browser - so I'm assuming that there's an issue with the cache that my server is hitting. Is this something to bring up here or should I let NCO Ops know? Thanks! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm experiencing inconsistent responses when calling the Weather.gov API endpoint https://api.weather.gov/gridpoints/LOX/160,43/forecast/hourly from my Java application compared to Postman requests.
When I make a request using Postman, I receive the expected weather forecast data. However, when I call the same endpoint with identical parameters from my Java application, the response differs significantly.
Here's the code I'm using to make the API request:
I've already tried:
Is there any known issue with the API that could cause different responses based on the client making the request? Are there specific headers or parameters required when accessing the API programmatically that might not be needed when using Postman?
Any guidance on how to ensure consistent responses between Postman and programmatic API calls would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions