Whats the best way to make a HTTP request in a cus...
# gradle
j
Whats the best way to make a HTTP request in a custom task?
v
To download a file? Or to trigger some API? Or ...?
j
trigger some api
v
Just use any HTTP client you like. For simple things even just using
new URL("...").openConnection()
might suffice. Or if for that API a Java wrapper exists, just use it. Or if the API provides an OpenAPI specification you can also use a generator to generate code like https://github.com/OpenAPITools/openapi-generator/