javax.net.ssl.HttpsURLConnection.getResponseMessage()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中javax.net.ssl.HttpsURLConnection.getResponseMessage()方法的一些代码示例,展示了HttpsURLConnection.getResponseMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpsURLConnection.getResponseMessage()方法的具体详情如下:
包路径:javax.net.ssl.HttpsURLConnection
类名称:HttpsURLConnection
方法名:getResponseMessage

HttpsURLConnection.getResponseMessage介绍

暂无

代码示例

代码示例来源:origin: jberkel/sms-backup-plus

private String getUsernameFromContacts(OAuth2Token token) {
  try {
    HttpsURLConnection connection = (HttpsURLConnection) new URL(CONTACTS_URL).openConnection();
    connection.addRequestProperty("Authorization", "Bearer "+token.accessToken);
    if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
      final InputStream inputStream = connection.getInputStream();
      String email = extractEmail(inputStream);
      inputStream.close();
      return email;
    } else {
      Log.w(TAG, String.format("unexpected server response: %d (%s)",
          connection.getResponseCode(), connection.getResponseMessage()));
      return null;
    }
  } catch (SAXException e) {
    Log.e(TAG, ERROR, e);
    return null;
  } catch (IOException e) {
    Log.e(TAG, ERROR, e);
    return null;
  } catch (ParserConfigurationException e) {
    Log.e(TAG, ERROR, e);
    return null;
  }
}

代码示例来源:origin: mucommander/mucommander

private void parseResponse(URLConnection conn) throws IOException {
  int responseCode = 0;
  String message = "";
  if (conn instanceof HttpURLConnection) {
    responseCode = ((HttpURLConnection) conn).getResponseCode();
    message = ((HttpsURLConnection) conn).getResponseMessage();
  }
  if (responseCode != 200) {
    throw new IOException("Failed to copy file using vsphere: "
        + message);
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.sts.passive.ui

if (log.isDebugEnabled()) {
  log.debug("Single logout cleanup request sent to " + realm + " returned with " +
       urlConnection.getResponseMessage());
     urlConnection.getResponseMessage());

代码示例来源:origin: ge0rg/MemorizingTrustManager

public void run() {
    try {
      URL u = new URL(urlString);
      HttpsURLConnection c = (HttpsURLConnection)u.openConnection();
      c.connect();
      setText("" + c.getResponseCode() + " "
          + c.getResponseMessage(), false);
      c.disconnect();
    } catch (Exception e) {
      setText(e.toString(), false);
      e.printStackTrace();
    }
  }
}.start();

代码示例来源:origin: bitcraze/crazyflie-android-client

String responseMsg = urlConnection.getResponseMessage();
int responseCode = urlConnection.getResponseCode();

代码示例来源:origin: labexp/osmtracker-android

+ " " + httpConnection.getResponseMessage());
  status = true;
} else{

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.sts/org.wso2.carbon.identity.sts.passive.ui

composeLogsFromResponse(responseCode, wreply, httpsUrlConnection.getResponseMessage());

代码示例来源:origin: denzilferreira/aware-client

Log.d(TAG, "Request: GET, URL: " + url);
Log.d(TAG, "Status: " + path_connection.getResponseCode());
Log.e(TAG, path_connection.getResponseMessage());

代码示例来源:origin: chenerzhu/proxy-pool

available = true;
  log.info("validateHttps ==> ip:{} port:{} info:{}", ip, port, httpsURLConnection.getResponseMessage());
} catch (Exception e) {

代码示例来源:origin: hawkular/hawkular-metrics

log.warnf("Error getting project metadata. Code %s: %s", responseCode, connection.getResponseMessage());

代码示例来源:origin: bitcraze/crazyflie-android-client

return "Server returned HTTP " + connection.getResponseCode() + " " + connection.getResponseMessage();

代码示例来源:origin: salrashid123/gcpsamples

System.out.println("Response Message : " + httpCon.getResponseMessage());

代码示例来源:origin: io.ballerina.messaging/broker-cli-client

if (Objects.isNull(con.getErrorStream())) {
  return new HttpResponse(responseCode,
      String.valueOf(responseCode) + " " + con.getResponseMessage());
response.append(String.valueOf(responseCode) + " " + con.getResponseMessage());

代码示例来源:origin: Microsoft/azure-tools-for-java

@NotNull
private static HttpResponse getResponse(@NotNull HttpsURLConnection sslConnection)
    throws IOException {
  int code = sslConnection.getResponseCode();
  String message = Strings.nullToEmpty(sslConnection.getResponseMessage());
  Map<String, List<String>> headers = sslConnection.getHeaderFields();
  if (headers == null) {
    headers = new HashMap<String, List<String>>();
  }
  InputStream is;
  String content;
  try {
    is = sslConnection.getInputStream();
  } catch (IOException e) {
    is = sslConnection.getErrorStream();
  }
  if (is != null) {
    content = readStream(is);
  } else {
    content = "";
  }
  return new HttpResponse(code, message, headers, content);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai

response.setResponseMessage(conn.getResponseMessage());
response.setContentType(conn.getContentType());
response.setContentEncoding(conn.getContentEncoding());

代码示例来源:origin: org.wso2.messaging/broker-cli-client

if (Objects.isNull(con.getErrorStream())) {
  return new HttpResponse(responseCode,
      String.valueOf(responseCode) + " " + con.getResponseMessage());

代码示例来源:origin: yavijava/yavijava-samples

System.out.println(conn.getResponseMessage());
conn.disconnect();

代码示例来源:origin: apache/jackrabbit-oak

protected void doHttpsUpload(InputStream in, long contentLength, URI uri) throws IOException {
  HttpsURLConnection conn = getHttpsConnection(contentLength, uri);
  IOUtils.copy(in, conn.getOutputStream());
  int responseCode = conn.getResponseCode();
  assertTrue(conn.getResponseMessage(), responseCode < 400);
}

代码示例来源:origin: apache/jackrabbit-oak

protected void doHttpsUpload(InputStream in, long contentLength, URI uri) throws IOException {
    HttpsURLConnection conn = getHttpsConnection(contentLength, uri);
    IOUtils.copy(in, conn.getOutputStream());
    int responseCode = conn.getResponseCode();
    assertTrue(conn.getResponseMessage(), responseCode < 400);
  }
}

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

throw new IOException(con.getResponseCode() + " " + con.getResponseMessage(), e);
} finally {
  if (in != null) {

相关文章

HttpsURLConnection类方法