philips-software / powershell-cf-api

PowerShell module can deploy and teardown CloudFoundry spaces and services via a json definition file
MIT License
5 stars 6 forks source link

common handling for rest requests #17

Open lipkau opened 4 years ago

lipkau commented 4 years ago

I strongly recommend having a custom proxy function for Invoke-WebRequest or having an internal function for the module to use for all requests. that way, you can dump all of the internals (baseurl, headers, pagination, etc) into one place and you have little refactoring in the public commands when you want to refactor internals or how calls are executed

Let me know if you are interested in a PR for this.

marklindell commented 4 years ago

I agree. This would also be a good place to implement retry logic on common HTTP failures due to connection issues.

marklindell commented 4 years ago

@lipkau Do you have any good examples of this I could steal, er, use?

lipkau commented 4 years ago

In my projects, I: