Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
FormPoster.cleanResponse
Retrieves the response string from the server and removes the HTTP header.
This method is similar to
cleanRawResponse
except the data is returned as a string rather than a byte array. This method has two variants:
- cleanResponse (Variant 1) retrieves the response string from the server and removes the HTTP header.
- cleanResponse (Variant 2) retrieves the response string from the server and removes the HTTP header and allows you to remove the trailing status code.
FormPoster.cleanResponse
Retrieves the response string from the server and removes the HTTP header. Optionally removes the trailing status code.
Syntax
public String cleanResponse()Description
The
cleanResponse
method retrieves the response string from the server and removes the HTTP header. This method is similar tocleanRawResponse
except the data is returned as a string rather than a byte array.Example
FormPoster fp = new FormPoster(); 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(); //--- // Fetch the response without the http headers CleanResponse = fp.cleanRawResponse(true); fp.login(false, ftStatus, null, null);See Also
getResponse , getRawResponse , cleanRawResponse
FormPoster.cleanResponse
Retrieves the response string from the server and removes the HTTP header. Optionally removes the trailing status code.
Syntax
public String cleanResponse(boolean bRemoveStatus)Parameters
bRemoveStatus
- Set this parameter to
true
to remove status; set it tofalse
to keep the status code.
Description
The
cleanResponse
method retrieves the response string from the server and removes the HTTP header.cleanResponse
optionally removes the trailing status code.This method is similar to cleanRawResponse except the data is returned as a string rather than as a byte array.
Example
FormPoster fp = new FormPoster(); 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(); //--- // Fetch the response without the http headers CleanResponse = fp.cleanRawResponse(true); fp.login(false, ftStatus, null, null);See Also
getResponse , getRawResponse , cleanRawResponse
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.