| | |
| | | */ |
| | | public class HttpHandler { |
| | | |
| | | private static final Integer DEFAULT_TIMEOUT_SECONDS = 5; |
| | | private static final Integer DEFAULT_TIMEOUT_SECONDS = 20; |
| | | private static final MediaType MEDIA_TYPE = MediaType.parse("application/json"); |
| | | |
| | | private String uri; |
| | |
| | | } |
| | | FormBody body = builder.build(); |
| | | request = headerBuilder |
| | | .url((https?"https://":"http://")+uri+path) |
| | | .url((https?"https://":"https://")+uri+path) |
| | | .post(body) |
| | | .build(); |
| | | } else { |
| | | RequestBody body = RequestBody.create(MEDIA_TYPE, json); |
| | | Request.Builder builder = headerBuilder.url((https?"https://":"http://")+uri+path); |
| | | Request.Builder builder = headerBuilder.url((https?"https://":"https://")+uri+path); |
| | | builder.header("Content-Type", "application/json"); |
| | | request = builder.post(body).build(); |
| | | |