private void uploadPing(final TelemetryPing ping, final ResultDelegate delegate) {
    final BaseResource resource;
    try {
      resource = new BaseResource(ping.getURL());
    } catch (final URISyntaxException e) {
      Log.w(LOGTAG, "URISyntaxException for server URL when creating BaseResource: returning.");
      return;
    }

    delegate.setResource(resource);
    resource.delegate = delegate;
    resource.setShouldCompressUploadedEntity(true);
    resource.setShouldChunkUploadsHint(false); // Telemetry servers don't support chunking.

    // We're in a background thread so we don't have any reason to do this asynchronously.
    // If we tried, onStartCommand would return and IntentService might stop itself before we
    // finish.
    resource.postBlocking(ping.getPayload());
  }