Class HTTPPostBuilder

java.lang.Object
VASSAL.tools.HTTPPostBuilder

@Deprecated(since="2021-06-28", forRemoval=true) public class HTTPPostBuilder extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use Apache HttpComponents instead. See BugUtils for an example.
Builds HTTP POST requests conveniently.
Since:
3.1.0
Author:
Joel Uckelman
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    post(String url)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Submits an HTTP POST request to the given URL.
    post(URL url)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Submits an HTTP POST request to the given URL.
    void
    setParameter(String name, File file)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a file to be uploaded as part of an HTTP POST request.
    void
    setParameter(String name, String value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a parameter for an HTTP POST request.
    void
    setParameter(String name, String filename, InputStream in)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a file to be uploaded as part of an HTTP POST request.
    void
    setParameter(String name, String filename, String contents)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a file to be uploaded as part of an HTTP POST request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HTTPPostBuilder

      public HTTPPostBuilder()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setParameter

      public void setParameter(String name, String value) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a parameter for an HTTP POST request.
      Parameters:
      name - the name of the parameter
      value - the value of the parameter
      Throws:
      IOException - in case of failure
    • setParameter

      public void setParameter(String name, File file) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a file to be uploaded as part of an HTTP POST request.
      Parameters:
      name - the name of the parameter
      file - the path to the file
      Throws:
      IOException - in case of failure
    • setParameter

      public void setParameter(String name, String filename, InputStream in) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a file to be uploaded as part of an HTTP POST request.
      Parameters:
      name - the name of the parameter
      filename - the path to the file
      in - an InputStream from which to read the file
      Throws:
      IOException - in case of failure
    • setParameter

      public void setParameter(String name, String filename, String contents) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a file to be uploaded as part of an HTTP POST request.
      Parameters:
      name - the name of the parameter
      filename - the path to the file
      contents - a String containing the file
      Throws:
      IOException - in case of failure
    • post

      public InputStream post(String url) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Submits an HTTP POST request to the given URL. This convenience method is equivalent to HTTPPostBuilder.post(new URL(url)).
      Parameters:
      url - the URL to receive the POST request
      Returns:
      the reply
      Throws:
      IOException - in case of failure
    • post

      public InputStream post(URL url) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Submits an HTTP POST request to the given URL.
      Parameters:
      url - the URL to receive the POST request
      Returns:
      the reply
      Throws:
      IOException - in case of failure