Tim Moores wrote:I'm confused. If you already have code that uses restLibOne, that should provide a good idea of what parameters are needed, and how to handle inputs and outputs, no?
Also, is there no documentation for restLibTwo? If they expect you to use it, they should tell you how to do that, no?
The problem is that I don't know how to design functions to make rest api calls. I don't know what all inputs are needed to make api calls besides simple inputs like url, headers, method, body etc. So, I don't know what arguments my api call making functions should have.
Paul Clapham wrote: It sounds like you want to write code to work with any kind of REST API whatsoever, but you don't know what all of those APIs do. If that's what your question means, then you're going about it backwards. You can't write an interface to an API which you don't understand. So your approach should be to document how those APIs work and then start writing code to interface with them. I'm making those statements based on what you said :
The problem is that I don't know how to design functions to make rest api calls. I don't know what all inputs are needed to make api calls besides simple inputs like url, headers, method, body etc. So, I don't know what arguments my api call making functions should have.
To me that sounds like you need to find out those things before trying to write the Universal REST API Caller. Start with one API, then look at another API and see what's different and what you missed, then look at another API and refactor when you find your code is becoming a mess.
| Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |