public class HTTPProtocol extends Object
This class contains HTTP protocol properties such as request headers. Response headers and other properties of the HTTP protocol can be added to this class.
Constructor and Description |
---|
HTTPProtocol() |
Modifier and Type | Method and Description |
---|---|
String |
get(String urlAsString,
String username,
String password)
Performs a get on urlAsString using username and password as credentials.
|
static String[] |
getRequestHeaders() |
public static String[] getRequestHeaders()
public String get(String urlAsString, String username, String password) throws IOException, org.apache.http.auth.AuthenticationException
If the status code returned not -1 and 401 then the contents are returned. If the status code is 401 an AuthenticationException is thrown.
All other values of status code are not dealt with but logic can be added as needed.
urlAsString
- username
- password
- org.apache.http.auth.AuthenticationException
IOException
Copyright © 2018 Hitachi Vantara. All rights reserved.