Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{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=1E59DEEA-5232-4E31-BE52-DDEC43368387}{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:1E59DEEA-5232-4E31-BE52-DDEC43368387_des|text=|trigger=button}{sub-section}{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_des|trigger=none|class=sIndent}Create a named
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryCreate an http client (like a web browser with session binding) usable todo multiple request/posts in same server session .Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.Create a http client configGet media (binary data) such as images in a variable.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)

functionservoy sDetail2100%height:30px2Methods DetailscreateNewHttpClientname

createNewHttpClient()

dessIndent
Create an 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:1E59DEEA-5232-4E31-BE52-DDEC43368387_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_prs|trigger=none}http_clientname {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_ret|text=|trigger=button}{sub-section}{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_see|text=|trigger=button}{sub-section}{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_see|text=|trigger=button}{sub-section}{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_sam|text=|trigger=button}{sub-section}{sub-section:1E59DEEA-5232-4E31-BE52-DDEC43368387_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=8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A}{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:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_des|text=|trigger=button}{sub-section}{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_des|trigger=none|class=sIndent}Delete a named http client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_prs|trigger=none}http_clientname {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_ret|text=|trigger=button}{sub-section}{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_see|text=|trigger=button}{sub-section}{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_see|text=|trigger=button}{sub-section}{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_sam|text=|trigger=button}{sub-section}{sub-section:8EBCD3A3-3DEA-40C0-B78B-3EE2F3D2E60A_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=433823EC-A01D-46B0-93B4-4597027E95C5}{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:433823EC-A01D-46B0-93B4-4597027E95C5_des|text=|trigger=button}{sub-section}{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_des|trigger=none|class=sIndent}Get cookie object from the specified client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_prs|trigger=none}clientName cookieName {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_ret|text=|trigger=button}{sub-section}{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_ret|trigger=none|class=sIndent}[Cookie]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_see|text=|trigger=button}{sub-section}{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_see|text=|trigger=button}{sub-section}{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_sam|text=|trigger=button}{sub-section}{sub-section:433823EC-A01D-46B0-93B4-4597027E95C5_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=41EA3D57-7F40-4566-A606-9D2238856251}{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:41EA3D57-7F40-4566-A606-9D2238856251_des|text=|trigger=button}{sub-section}{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_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:41EA3D57-7F40-4566-A606-9D2238856251_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_prs|trigger=none}clientName {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_ret|text=|trigger=button}{sub-section}{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_ret|trigger=none|class=sIndent}[Cookie]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_see|text=|trigger=button}{sub-section}{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_see|text=|trigger=button}{sub-section}{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_sam|text=|trigger=button}{sub-section}{sub-section:41EA3D57-7F40-4566-A606-9D2238856251_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=8819120D-1FB1-4DF1-B1CD-4DC3720A2374}{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:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_des|text=|trigger=button}{sub-section}{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_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:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_ret|text=|trigger=button}{sub-section}{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_see|text=|trigger=button}{sub-section}{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_see|text=|trigger=button}{sub-section}{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_sam|text=|trigger=button}{sub-section}{sub-section:8819120D-1FB1-4DF1-B1CD-4DC3720A2374_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=0B810748-3AA4-4A55-A120-988C5EBF7DA8}{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:0B810748-3AA4-4A55-A120-988C5EBF7DA8_des|text=|trigger=button}{sub-section}{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_des|trigger=none|class=sIndent}

.
WARNING: Make sure you call client.close() on it after you used this client object to clean up resources.
Starting a HTTPClient is the same as starting an actual browser without UI!
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
createNewHttpClientname

createNewHttpClient(config)

dessIndent
Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.

WARNING: Make sure you call client.close() on it after you used this client object to clean up resources.
Starting a HTTPClient is the same as starting an actual browser without UI!
prs

Parameters

sIndentconfighttpclient config
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
createNewHttpClientConfigname

createNewHttpClientConfig()

dessIndent
Create a http client config
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getMediaDataname

getMediaData(url)

dessIndent
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:0B810748-3AA4-4A55-A120-988C5EBF7DA8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_prs|trigger=none}url \[http_clientname\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_ret|text=|trigger=button}{sub-section}{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_see|text=|trigger=button}{sub-section}{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_see|text=|trigger=button}{sub-section}{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_sam|text=|trigger=button}{sub-section}{sub-section:0B810748-3AA4-4A55-A120-988C5EBF7DA8_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=8A5153F5-95AB-44AB-BE54-25868CA8DCFC}{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:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_des|text=|trigger=button}{sub-section}{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_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:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_prs|trigger=none}url \[http_clientname\] \[username\] \[password\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_ret|text=|trigger=button}{sub-section}{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_see|text=|trigger=button}{sub-section}{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_see|text=|trigger=button}{sub-section}{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_sam|text=|trigger=button}{sub-section}{sub-section:8A5153F5-95AB-44AB-BE54-25868CA8DCFC_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=A626CC8B-08D5-49E7-AA35-1BBA50D56649}{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:A626CC8B-08D5-49E7-AA35-1BBA50D56649_des|text=|trigger=button}{sub-section}{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_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:A626CC8B-08D5-49E7-AA35-1BBA50D56649_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_prs|trigger=none}url \[http_clientname\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_ret|text=|trigger=button}{sub-section}{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_ret|trigger=none|class=sIndent}[Poster]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_see|text=|trigger=button}{sub-section}{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_see|text=|trigger=button}{sub-section}{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_sam|text=|trigger=button}{sub-section}{sub-section:A626CC8B-08D5-49E7-AA35-1BBA50D56649_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=DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9}{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:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_des|text=|trigger=button}{sub-section}{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_des|trigger=none|class=sIndent}Put a file at the specified URL.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_prs|trigger=none}clientName url fileName filePath \[username\] \[password\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_ret|text=|trigger=button}{sub-section}{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_see|text=|trigger=button}{sub-section}{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_see|text=|trigger=button}{sub-section}{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_sam|text=|trigger=button}{sub-section}{sub-section:DA1DDE4E-A2DF-4960-B4BC-FFD4AB67B7D9_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=54CE90E4-33ED-44C9-8442-231D9DE30843}{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:54CE90E4-33ED-44C9-8442-231D9DE30843_des|text=|trigger=button}{sub-section}{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_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:54CE90E4-33ED-44C9-8442-231D9DE30843_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_prs|trigger=none}username password {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_ret|text=|trigger=button}{sub-section}{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_see|text=|trigger=button}{sub-section}{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_see|text=|trigger=button}{sub-section}{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_sam|text=|trigger=button}{sub-section}{sub-section:54CE90E4-33ED-44C9-8442-231D9DE30843_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=DA63C677-C37E-4AA8-94AE-4C0028BDF713}{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:DA63C677-C37E-4AA8-94AE-4C0028BDF713_des|text=|trigger=button}{sub-section}{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_des|trigger=none|class=sIndent}Add cookie to the specified client.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_prs|trigger=none}clientName cookieName cookieValue \[domain\] \[path\] \[maxAge\] \[secure\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_ret|text=|trigger=button}{sub-section}{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_see|text=|trigger=button}{sub-section}{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_see|text=|trigger=button}{sub-section}{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_sam|text=|trigger=button}{sub-section}{sub-section:DA63C677-C37E-4AA8-94AE-4C0028BDF713_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}

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)
prs

Parameters

sIndenturl ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getPageDataname

getPageData(url)

dessIndent
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)
prs

Parameters

sIndenturl ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow