Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
{hidden} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden} {sub-section:description|text=}{sub-section}\\{table:class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[Cookie]{span}{span:class=sWordList}[Poster]{span}{td}{tr}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#createHttpClient]\(http_clientname) Create a named http client (like a web browser with session binding) usable todo multiple request/posts in same server session.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#deleteHttpClient]\(http_clientname) Delete a named http client.{td}{tr}{tbody}{tbody}{tr}{td}[Cookie]{td}{td}[#getHttpClientCookie]\(clientName, cookieName) Get cookie object from the specified client.{td}{tr}{tbody}{tbody}{tr}{td}[Cookie]\[]{td}{td}[#getHttpClientCookies]\(clientName) Returns a Cookie array with all the cookies set on the specified client.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getLastPageCharset]\() Get the charset of the last page received with getPageData(.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#getMediaData]\(url, http_clientname) Get media (binary data) such as images in a variable.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getPageData]\(url, http_clientname, username, password) Get all page html in a variable (authentication only works with http client usage).{td}{tr}{tbody}{tbody}{tr}{td}[Poster]{td}{td}[#getPoster]\(url, http_clientname) Get poster object to do http (file) posts.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#put]\(clientName, url, fileName, filePath, username, password) Put a file at the specified URL.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setClientProxyUserNamePassword]\(username, password) Set the proxy username and password.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setHttpClientCookie]\(clientName, cookieName, cookieValue, domain, path, maxAge, secure) Add cookie to the specified client.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=700897BC-E44E-46E5-A652-B53869F02957}{tr:id=name}{td}h6.createHttpClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}createHttpClient{span}{span:id=iets|style=float: left;}\(http_clientname){span}{td}{tr}{tr:id=des}{td}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_des|text=|trigger=button}{sub-section}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_des|trigger=none|class=sIndent}Create a named http client (like a web browser with session binding) usable todo multiple request/posts in same server session.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:700897BC-E44E-46E5-A652-B53869F02957_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_prs|trigger=none}http_clientname {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:700897BC-E44E-46E5-A652-B53869F02957_ret|text=|trigger=button}{sub-section}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:700897BC-E44E-46E5-A652-B53869F02957_see|text=|trigger=button}{sub-section}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:700897BC-E44E-46E5-A652-B53869F02957_see|text=|trigger=button}{sub-section}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:700897BC-E44E-46E5-A652-B53869F02957_sam|text=|trigger=button}{sub-section}{sub-section:700897BC-E44E-46E5-A652-B53869F02957_sam|class=sIndent|trigger=none}{code:language=javascript} plugins.http.createHttpClient('mybrowser'); var pageData = plugins.http.getPageData('http://www.cnn.com','mybrowser','username','mypassword'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0533DC31-30D1-4549-ACDB-71A54F5F06CE}{tr:id=name}{td}h6.deleteHttpClient{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}deleteHttpClient{span}{span:id=iets|style=float: left;}\(http_clientname){span}{td}{tr}{tr:id=des}{td}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_des|text=|trigger=button}{sub-section}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_des|trigger=none|class=sIndent}Delete a named http client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_prs|trigger=none}http_clientname {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_ret|text=|trigger=button}{sub-section}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_see|text=|trigger=button}{sub-section}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_see|text=|trigger=button}{sub-section}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_sam|text=|trigger=button}{sub-section}{sub-section:0533DC31-30D1-4549-ACDB-71A54F5F06CE_sam|class=sIndent|trigger=none}{code:language=javascript} plugins.http.deleteHttpClient('mybrowser'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6F217F00-D338-4147-991D-673BF1046DB3}{tr:id=name}{td}h6.getHttpClientCookie{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Cookie]{span}{span:id=iets|style=float: left; font-weight: bold;}getHttpClientCookie{span}{span:id=iets|style=float: left;}\(clientName, cookieName){span}{td}{tr}{tr:id=des}{td}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_des|text=|trigger=button}{sub-section}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_des|trigger=none|class=sIndent}Get cookie object from the specified client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_prs|trigger=none}clientName cookieName {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_ret|text=|trigger=button}{sub-section}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_ret|trigger=none|class=sIndent}[Cookie]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_see|text=|trigger=button}{sub-section}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_see|text=|trigger=button}{sub-section}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_sam|text=|trigger=button}{sub-section}{sub-section:6F217F00-D338-4147-991D-673BF1046DB3_sam|class=sIndent|trigger=none}{code:language=javascript} var cookie = plugins.http.getHttpClientCookie('clientName', 'JSESSIONID'); if (cookie != null) { // do something } else plugins.http.setHttpClientCookie('clientName', 'JSESSIONID', 'abc', 'localhost', '/', -1, false) {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC}{tr:id=name}{td}h6.getHttpClientCookies{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Cookie]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getHttpClientCookies{span}{span:id=iets|style=float: left;}\(clientName){span}{td}{tr}{tr:id=des}{td}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_des|text=|trigger=button}{sub-section}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_des|trigger=none|class=sIndent}Returns a Cookie array with all the cookies set on the specified client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_prs|trigger=none}clientName {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_ret|text=|trigger=button}{sub-section}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_ret|trigger=none|class=sIndent}[Cookie]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_see|text=|trigger=button}{sub-section}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_see|text=|trigger=button}{sub-section}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_sam|text=|trigger=button}{sub-section}{sub-section:D11A64D5-FFD3-4C30-B8B6-4D7AB3A887DC_sam|class=sIndent|trigger=none}{code:language=javascript} var cookies = plugins.http.getHttpClientCookies('clientName') {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DA30AC69-2FD8-424B-80CD-949677057173}{tr:id=name}{td}h6.getLastPageCharset{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getLastPageCharset{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_des|text=|trigger=button}{sub-section}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_des|trigger=none|class=sIndent}Get the charset of the last page received with getPageData(...){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_ret|text=|trigger=button}{sub-section}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_see|text=|trigger=button}{sub-section}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_see|text=|trigger=button}{sub-section}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_sam|text=|trigger=button}{sub-section}{sub-section:DA30AC69-2FD8-424B-80CD-949677057173_sam|class=sIndent|trigger=none}{code:language=javascript} var a = plugins.http.getPageData('http://www.google.com.hk'); var charset = plugins.http.getLastPageCharset(); var success = plugins.file.writeTXTFile('someFilePath', a, charset); if (!success) plugins.dialogs.showWarningDialog('Warning', 'Could not write file', 'OK'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3D798D9E-432E-4100-B0C8-C520948EF6E2}{tr:id=name}{td}h6.getMediaData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}getMediaData{span}{span:id=iets|style=float: left;}\(url, http_clientname){span}{td}{tr}{tr:id=des}{td}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_des|text=|trigger=button}{sub-section}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_des|trigger=none|class=sIndent}Get media (binary data) such as images in a variable. It also supports gzip-ed content.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_prs|trigger=none}url \[http_clientname\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_ret|text=|trigger=button}{sub-section}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_see|text=|trigger=button}{sub-section}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_see|text=|trigger=button}{sub-section}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_sam|text=|trigger=button}{sub-section}{sub-section:3D798D9E-432E-4100-B0C8-C520948EF6E2_sam|class=sIndent|trigger=none}{code:language=javascript} var image_byte_array = plugins.http.getMediaData('http://www.cnn.com/cnn.gif'); var image_byte_array2 = plugins.http.getMediaData('http://www.cnn.com/cnn.gif', 'clientName'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F35764D7-CAC9-4301-9D6D-2F393E5038EB}{tr:id=name}{td}h6.getPageData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getPageData{span}{span:id=iets|style=float: left;}\(url, http_clientname, username, password){span}{td}{tr}{tr:id=des}{td}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_des|text=|trigger=button}{sub-section}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_des|trigger=none|class=sIndent}Get all page html in a variable (authentication only works with http client usage). If name is provided a http client will be created/used.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_prs|trigger=none}url \[http_clientname\] \[username\] \[password\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_ret|text=|trigger=button}{sub-section}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_see|text=|trigger=button}{sub-section}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_see|text=|trigger=button}{sub-section}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_sam|text=|trigger=button}{sub-section}{sub-section:F35764D7-CAC9-4301-9D6D-2F393E5038EB_sam|class=sIndent|trigger=none}{code:language=javascript} // get data using a default connection var pageData = plugins.http.getPageData('http://www.cnn.com'); // create an http client and use it to get the data var pageData = plugins.http.getPageData('http://www.cnn.com','myclient'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=62D20D9C-AEC4-44D8-9A80-EDE11243FDAA}{tr:id=name}{td}h6.getPoster{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Poster]{span}{span:id=iets|style=float: left; font-weight: bold;}getPoster{span}{span:id=iets|style=float: left;}\(url, http_clientname){span}{td}{tr}{tr:id=des}{td}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_des|text=|trigger=button}{sub-section}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_des|trigger=none|class=sIndent}Get poster object to do http (file) posts. If posting files, it will post multipart!{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_prs|trigger=none}url \[http_clientname\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_ret|text=|trigger=button}{sub-section}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_ret|trigger=none|class=sIndent}[Poster]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_see|text=|trigger=button}{sub-section}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_see|text=|trigger=button}{sub-section}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_sam|text=|trigger=button}{sub-section}{sub-section:62D20D9C-AEC4-44D8-9A80-EDE11243FDAA_sam|class=sIndent|trigger=none}{code:language=javascript} var poster = plugins.http.getPoster('http://www.abc.com/apply_form.jsp'); var didAddParam = poster.addParameter('myParamName','myValue'); var didAddFile = poster.addFile('myFileParamName','manual.doc','c:/temp/manual_01a.doc'); var httpCode = poster.doPost('username','mypassword'); //httpCode 200 is ok //var httpCode = poster.doPost('username','mypassword'); //use if authentication is needed var pageData = poster.getPageData() {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CC8D0631-901F-4BAC-9C30-F8D2C8024AAF}{tr:id=name}{td}h6.put{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}put{span}{span:id=iets|style=float: left;}\(clientName, url, fileName, filePath, username, password){span}{td}{tr}{tr:id=des}{td}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_des|text=|trigger=button}{sub-section}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_des|trigger=none|class=sIndent}Put a file at the specified URL.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_prs|trigger=none}clientName url fileName filePath \[username\] \[password\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_ret|text=|trigger=button}{sub-section}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_see|text=|trigger=button}{sub-section}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_see|text=|trigger=button}{sub-section}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_sam|text=|trigger=button}{sub-section}{sub-section:CC8D0631-901F-4BAC-9C30-F8D2C8024AAF_sam|class=sIndent|trigger=none}{code:language=javascript} var fileAdded = plugins.http.put('clientName', 'http://www.abc.com/put_stuff.jsp', 'manual.doc', 'c:/temp/manual_01a.doc', 'user', 'password') {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CCED0EBE-938A-4560-B4EC-B4996FE5ED58}{tr:id=name}{td}h6.setClientProxyUserNamePassword{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setClientProxyUserNamePassword{span}{span:id=iets|style=float: left;}\(username, password){span}{td}{tr}{tr:id=des}{td}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_des|text=|trigger=button}{sub-section}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_des|trigger=none|class=sIndent}Set the proxy username and password. Used for named http clients ( else use implicit java data).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_prs|trigger=none}username password {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_ret|text=|trigger=button}{sub-section}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_see|text=|trigger=button}{sub-section}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_see|text=|trigger=button}{sub-section}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_sam|text=|trigger=button}{sub-section}{sub-section:CCED0EBE-938A-4560-B4EC-B4996FE5ED58_sam|class=sIndent|trigger=none}{code:language=javascript} plugins.http.setClientProxyUserNamePassword('my_proxy_username','my_proxy_password'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F667F7D2-1B47-4EA5-9D22-B73BADE2A096}{tr:id=name}{td}h6.setHttpClientCookie{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setHttpClientCookie{span}{span:id=iets|style=float: left;}\(clientName, cookieName, cookieValue, domain, path, maxAge, secure){span}{td}{tr}{tr:id=des}{td}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_des|text=|trigger=button}{sub-section}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_des|trigger=none|class=sIndent}Add cookie to the specified client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_prs|trigger=none}clientName cookieName cookieValue \[domain\] \[path\] \[maxAge\] \[secure\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_ret|text=|trigger=button}{sub-section}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_see|text=|trigger=button}{sub-section}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_see|text=|trigger=button}{sub-section}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_sam|text=|trigger=button}{sub-section}{sub-section:F667F7D2-1B47-4EA5-9D22-B73BADE2A096_sam|class=sIndent|trigger=none}{code:language=javascript} var cookieSet = plugins.http.setHttpClientCookie('clientName', 'JSESSIONID', 'abc', 'localhost', '/', -1, false) if (cookieSet) { //do something } {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Wiki Markup
Div
styledisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

Div
iddescription



HTML Table
id
classservoy sReturnTypes
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Return Types
Table Row (tr)
Table Cell (td)
Span
classsWordList
Cookie
Span
classsWordList
DeleteRequest
Span
classsWordList
GetRequest
Span
classsWordList
HTTP_STATUS
Span
classsWordList
HeadRequest
Span
classsWordList
HttpClient
Span
classsWordList
OptionsRequest
Span
classsWordList
PostRequest
Span
classsWordList
PutRequest
Span
classsWordList
Response
Span
classsWordList
TraceRequest



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
HttpClient
Table Cell (td)
createNewHttpClient()
Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
getMediaData(url)
Get media (binary data) such as images in a variable.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getPageData(url)
Get all page html in a variable, if this url is an https url that uses certificates unknown to Java
then you have to use the HttpClient so that smart client users will get the unknown certificate dialog that they then can accept
or you must make sure that those server certificates are stored in the cacerts of the java vm that is used (this is required for a web or headless client)



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idcreateNewHttpClient
Table Row (tr)
idname
Table Cell (td)

createNewHttpClient

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
HttpClient
Span
stylefont-weight: bold;
createNewHttpClient
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
HttpClient
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var client = plugins.http.createNewHttpClient();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetMediaData-String
Table Row (tr)
idname
Table Cell (td)

getMediaData

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
getMediaData
Span
(url)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get media (binary data) such as images in a variable. It also supports gzip-ed content.
If this url is an https url that uses certificates unknown to Java
then you have to use the HttpClient so that smart client users will get the unknown certificate dialog that they then can accept
or you must make sure that those server certificates are stored in the cacerts of the java vm that is used (this is required for a web or headless client)
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} url
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var image_byte_array = plugins.http.getMediaData('http://www.cnn.com/cnn.gif');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPageData-String
Table Row (tr)
idname
Table Cell (td)

getPageData

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getPageData
Span
(url)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get all page html in a variable, if this url is an https url that uses certificates unknown to Java
then you have to use the HttpClient so that smart client users will get the unknown certificate dialog that they then can accept
or you must make sure that those server certificates are stored in the cacerts of the java vm that is used (this is required for a web or headless client)
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} url
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// get data using a default connection
var pageData = plugins.http.getPageData('http://www.cnn.com');
Table Row (tr)
classlastDetailRow
Table Cell (td)