Enviar um URI

Crie um cliente Webrisk e envie um URI.

Exemplo de código

Java

public static Submission submitUriExample(String uri) throws IOException {
  // create-webrisk-client
  try (WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.create()) {
    Submission submission = Submission.newBuilder().setUri(uri).build();
    CreateSubmissionRequest submissionRequest =
        CreateSubmissionRequest.newBuilder()
            .setParent("projects/your-project-id")
            .setSubmission(submission)
            .build();
    Submission submissionResponse = webRiskServiceClient.createSubmission(submissionRequest);
    webRiskServiceClient.shutdownNow();
    System.out.println("The submitted " + submissionResponse);
    return submissionResponse;
  }
}

A seguir

Para pesquisar e filtrar exemplos de código de outros produtos do Google Cloud, consulte o navegador de exemplos do Google Cloud.