Search in sources :

Example 1 with PostRequest

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();
}
Also used : PostRequest(org.sonarsource.sonarlint.core.util.ws.PostRequest)

Example 2 with PostRequest

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;
}
Also used : PostRequest(org.sonarsource.sonarlint.core.util.ws.PostRequest) WsResponse(org.sonarsource.sonarlint.core.util.ws.WsResponse)

Aggregations

PostRequest (org.sonarsource.sonarlint.core.util.ws.PostRequest)2 WsResponse (org.sonarsource.sonarlint.core.util.ws.WsResponse)1