// GET Request
URL url = new URL("http://" + address.getHostName() + ":" + address.getPort() + "/redirect/");
HttpURLConnection uc = (HttpURLConnection)url.openConnection(NO_PROXY);
uc.setRequestProperty("Authorization", "testString:ValueDoesNotMatter"); int resp = uc.getResponseCode();
System.out.println("Response Code is " + resp); if (resp != 200) thrownew RuntimeException("Failed: Authorization header was not retained after redirect");
/** *HttpServer
*/ void startHttpServer() throws IOException {
InetAddress address = InetAddress.getLocalHost(); if (!InetAddress.getByName(address.getHostName()).equals(address)) { // if this happens then we should possibly change the client // side to use the address literal in its URL instead of // the host name. thrownew IOException(address.getHostName()
+ " resolves to "
+ InetAddress.getByName(address.getHostName())
+ " not to "
+ address + ": check host configuration.");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.