@ShellComponent public class HttpCommands extends Object
Constructor and Description |
---|
HttpCommands() |
Modifier and Type | Method and Description |
---|---|
String |
getHttp(String target,
String username,
String password,
boolean skipSslValidation) |
String |
postHttp(String target,
String data,
File file,
MediaType mediaType,
String username,
String password,
boolean skipSslValidation) |
@ShellMethod(key="http post", value="POST data to http endpoint") public String postHttp(@ShellOption(value={"","--target"},help="the location to post to",defaultValue="http://localhost:9393/") String target, @ShellOption(help="the text payload to post. exclusive with file. embedded double quotes are not supported if next to a space character",defaultValue="__NULL__") String data, @ShellOption(help="filename to read data from. exclusive with data",defaultValue="__NULL__") File file, @ShellOption(value="--contentType",help="the content-type to use. file is also read using the specified charset",defaultValue="text/plain") MediaType mediaType, @ShellOption(help="the username for calls that require basic authentication",defaultValue="") String username, @ShellOption(help="the password for calls that require basic authentication",defaultValue="") String password, @ShellOption(help="accept any SSL certificate (even \"self-signed)\"",defaultValue="false") boolean skipSslValidation) throws IOException
IOException
@ShellMethod(key="http get", value="Make GET request to http endpoint") public String getHttp(@ShellOption(value={"","--target"},help="the URL to make the request to",defaultValue="http://localhost:9393/") String target, @ShellOption(help="the username for calls that require basic authentication",defaultValue="") String username, @ShellOption(help="the password for calls that require basic authentication",defaultValue="") String password, @ShellOption(help="accept any SSL certificate (even \"self-signed)\"",defaultValue="false") boolean skipSslValidation)
Copyright © 2024 Pivotal Software, Inc.. All rights reserved.