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