Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IdHTTP Post problem
(07-11-2019, 10:46 PM)BartKindt Wrote: I am trying to post weather data to the OpenWeatherMap API server.
They use a RESTful server (API 3.0).
The documentation on this is totally incomplete.

In what way exactly? Reading the API documentation, it looks quite complete and straight forward to me. But I see no version 3.0, only version 2.5. What part of the API exactly are you having trouble with?

(07-11-2019, 10:46 PM)BartKindt Wrote: Using a third-party program called 'ARC' and a lot of research, I discovered that in addition to adding the KEY to the URL, it is also required that *before* the HTTP Request the same KEY is send, which in this ARC program is called an 'Action', with a 'Name' and a 'value'.

I see nothing like that mentioned in the API documentation. Can you be more specific?

(07-11-2019, 10:46 PM)BartKindt Wrote: In another application reference on the Internet the same name+value where added in what was called the 'Params' of this application.

Can you provide a link to that reference?

(07-11-2019, 10:46 PM)BartKindt Wrote: The only Params I have been able to find in the IdHTTP Client is here:


That is the completely wrong place to put API parameters. They need to go either in the query string component of the URL itself (as this weather API appears to use), or in the post body (which this weather API does not use).

(07-11-2019, 10:46 PM)BartKindt Wrote: I am not even sure if this is the right location for this 'name' + 'Key'.

It is not.

(07-11-2019, 10:46 PM)BartKindt Wrote: The OpenWeatherMap API does not do any negotiation; When the HTTP Post is not excactly correct, it just gives a '400' and disconnects.

OnAuthorisation and OnSelectAuthorisation are never called.

Because this weather API does not use HTTP authentication. You have to include your API appkey in each request. That is your authentication.

(07-11-2019, 10:46 PM)BartKindt Wrote: How am I to add these values to the HTTP Post, *before* the body containing JSON data is send?

You don't send anything before a request. Whereever you got that idea from is wrong. The API documentation is very clear on this:

Quote:Example of using API key in API call


Please, use your API key in each API call.

We do not process API requests without the API key.

API call:



APPID {APIKEY} is your unique API key 

Example of API call:



Messages In This Thread
IdHTTP Post problem - by BartKindt - 07-11-2019, 10:46 PM
RE: IdHTTP Post problem - by rlebeau - 07-16-2019, 04:19 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)