Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
FormPoster.setHTTPVersion
Sets the HTTP protocol version to use.
Syntax
public void setHTTPVersion(int nVersion) throws java.lang.ExceptionParameters
nVersion- Value for the HTTP protocol. Valid values are as follows:
FormPoster.HTTPVERSION10FormPoster.HTTPVERSION11Description
The
setHTTPVersionmethod sets the HTTP protocol version. By default the FormPoster object transmits data using HTTP version 1.0.Throws
Exception if the HTTP version is invalid.
Example
FormPoster fp = new FormPoster(); // Use HTTP 1.1 fp.setHTTPVersion(FormPoster.HTTPVERSION11); FTValList vlCookies; fp.setURL("http://myserver/servlet/CatalogManager"); // Add a new row to MyTable FTStatusCode ftStatus = new FTStatusCode(); status = fp.login(true, ftStatus, "myusername", "mypassword"); vlCookies = fp.findAllCookies(); Status = fp.addFile("url", "test.html", "/export/home/temp/test.html", "text/html"); Status = fp.addTextValue("tblname", "MyTable"); Status = fp.addURL("myparameter", "http://server/main.html"); Status = fp.addTextValue("id", "1323"); Status = fp.addTextValue("ftcmd", "addrow"); fp.setCookies(vlCookies); Status = fp.post(); int nLastErrorCode = fp.getLastError(); String sLastError = fp.getLastErrorStr(); // Fetch the response byte[] byResponse = fp.getRawResponse(); fp.login(false, ftStatus, null, null);
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.