Java Code Examples for javax.microedition.io.HttpConnection#POST

The following examples show how to use javax.microedition.io.HttpConnection#POST . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpClientConnection.java    From knopflerfish.org with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void setRequestMethod(String method) throws IOException {
  if (!HttpConnection.GET.equals(method) &&
      !HttpConnection.HEAD.equals(method) &&
      !HttpConnection.POST.equals(method) &&
      !PUT_METHOD.equals(method) &&
      !DELETE_METHOD.equals(method)) {
    throw new IllegalArgumentException("method should be one of " +
                                       HttpConnection.GET + ", " +
                                       HttpConnection.HEAD + ", " +
                                       HttpConnection.POST + ", " +
                                       PUT_METHOD + " and " +
                                       DELETE_METHOD);
  }

  if (state == STATE_CLOSED) {
    init();
  }

  if (state != STATE_SETUP) {
    throw new ProtocolException("Can't reset method: already connected");
  }

  if (out != null && !(HttpConnection.POST.equals(method) || PUT_METHOD.equals(method))) {
    // When an outputstream has been created these calls are ignored.
    return ;
  }

  if (this.method != method && resCache != null) {
    // TODO: here we should convert an existing resCache
    throw new RuntimeException
      ("Not yet implemented, as a work around you can always set"
       +" the request method the first thing you do..");
  }

  this.method = method;
}
 
Example 2
Source File: LoginOperation.java    From pluotsorbet with GNU General Public License v2.0 4 votes vote down vote up
/**
 * This operation uses the HTTP POST method.
 */
public String getRequestMethod() {
    return HttpConnection.POST;
}
 
Example 3
Source File: CommentPostOperation.java    From pluotsorbet with GNU General Public License v2.0 4 votes vote down vote up
public String getRequestMethod() {
    return HttpConnection.POST;
}
 
Example 4
Source File: VotePostOperation.java    From pluotsorbet with GNU General Public License v2.0 4 votes vote down vote up
public String getRequestMethod() {
    return HttpConnection.POST;
}