Class HttpService
- java.lang.Object
-
- io.jenkins.plugins.kobiton.services.HttpService
-
public class HttpService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpService.Builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget(String url, Credential credential)Call GET request with credentialStringpost(String url, Credential credential, String body)Call POST request with credential and bodyStringput(String url, String filePath)Call PUT request with file content
-
-
-
Method Detail
-
get
public String get(String url, Credential credential) throws IOException
Call GET request with credential- Parameters:
url- API urlcredential- credential- Returns:
- response body
- Throws:
IOException- if API call fail
-
post
public String post(String url, Credential credential, String body) throws IOException
Call POST request with credential and body- Parameters:
url- API urlcredential- credentialbody- request body- Returns:
- response body
- Throws:
IOException- if API call fail
-
put
public String put(String url, String filePath) throws IOException
Call PUT request with file content- Parameters:
url- API urlfilePath- path to upload file- Returns:
- response body
- Throws:
IOException- if API call fail
-
-