use of org.sonarsource.sonarlint.core.util.ws.PostRequest in project sonarlint-core by SonarSource.
the class TelemetryClient method sendPost.
private static void sendPost(HttpConnector httpConnector, TelemetryPayload payload) {
String json = payload.toJson();
PostRequest post = new PostRequest(TELEMETRY_PATH);
post.setMediaType(MediaTypes.JSON);
httpConnector.post(post, json).failIfNotSuccessful().close();
}
use of org.sonarsource.sonarlint.core.util.ws.PostRequest in project sonarlint-core by SonarSource.
the class SonarLintWsClient method rawPost.
/**
* Execute POST and don't check response
*/
public WsResponse rawPost(String path) {
long startTime = System2.INSTANCE.now();
PostRequest request = new PostRequest(path);
WsResponse response = client.call(request);
long duration = System2.INSTANCE.now() - startTime;
if (LOG.isDebugEnabled()) {
LOG.debug("{} {} {} | time={}ms", request.getMethod(), response.code(), response.requestUrl(), duration);
}
return response;
}
Aggregations