本文整理了Java中com.meterware.httpunit.WebRequest.getHeaderDictionary()
方法的一些代码示例,展示了WebRequest.getHeaderDictionary()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebRequest.getHeaderDictionary()
方法的具体详情如下:
包路径:com.meterware.httpunit.WebRequest
类名称:WebRequest
方法名:getHeaderDictionary
暂无
代码示例来源:origin: httpunit/httpunit
/**
* Returns a copy of the headers to be sent with this request.
* @return the dictionary of headers
**/
public Dictionary getHeaders() {
return (Dictionary) getHeaderDictionary().clone();
}
代码示例来源:origin: httpunit/httpunit
/**
* Sets the value of a header to be sent with this request. A header set here will override any matching header set
* in the WebClient when the request is actually sent.
* @param headerName - the name of the header
* @param headerValue - the value to be set
*/
public void setHeaderField( String headerName, String headerValue ) {
getHeaderDictionary().put( headerName, headerValue );
}
代码示例来源:origin: javanettasks/httpunit
/**
* Sets the value of a header to be sent with this request. A header set here will override any matching header set
* in the WebClient when the request is actually sent.
* @param headerName - the name of the header
* @param headerValue - the value to be set
*/
public void setHeaderField( String headerName, String headerValue ) {
getHeaderDictionary().put( headerName, headerValue );
}
代码示例来源:origin: javanettasks/httpunit
/**
* Returns a copy of the headers to be sent with this request.
* @return the dictionary of headers
**/
public Dictionary getHeaders() {
return (Dictionary) getHeaderDictionary().clone();
}
代码示例来源:origin: org.kohsuke.httpunit/httpunit
/**
* Sets the value of a header to be sent with this request. A header set here will override any matching header set
* in the WebClient when the request is actually sent.
* @param headerName - the name of the header
* @param headerValue - the value to be set
*/
public void setHeaderField( String headerName, String headerValue ) {
getHeaderDictionary().put( headerName, headerValue );
}
代码示例来源:origin: org.kohsuke.httpunit/httpunit
/**
* Returns a copy of the headers to be sent with this request.
* @return the dictionary of headers
**/
public Dictionary getHeaders() {
return (Dictionary) getHeaderDictionary().clone();
}
代码示例来源:origin: org.kohsuke.httpunit/httpunit
/**
* Creates a web response object which represents the response to the specified web request.
**/
protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException, IOException {
Properties savedProperties = (Properties) System.getProperties().clone();
try {
if (_proxyHost != null) {
System.setProperty( "proxyHost", _proxyHost );
System.setProperty( "proxyPort", Integer.toString( _proxyPort ) );
}
URLConnection connection = openConnection( getRequestURL( request ) );
// [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
// XXX enable for 1.7 release in 2008
// comment out if you need this and have JDK 1.5
// if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
// if (_readTimeout>=0) connection.setReadTimeout( _readTimeout );
if (HttpUnitOptions.isLoggingHttpHeaders()) {
String urlString = request.getURLString();
System.out.println( "\nConnecting to " + request.getURL().getHost() );
System.out.println( "Sending:: " + request.getMethod() + " " + urlString );
}
sendHeaders( connection, getHeaderFields( request.getURL() ) );
sendHeaders( connection, request.getHeaderDictionary() );
request.completeRequest( connection );
return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() );
} finally {
System.setProperties( savedProperties );
}
}
代码示例来源:origin: httpunit/httpunit
/**
* Creates a web response object which represents the response to the specified web request.
**/
protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException, IOException {
Properties savedProperties = (Properties) System.getProperties().clone();
try {
if (_proxyHost != null) {
System.setProperty( "proxyHost", _proxyHost );
System.setProperty( "proxyPort", Integer.toString( _proxyPort ) );
}
URLConnection connection = openConnection( getRequestURL( request ) );
// [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
// XXX enable for 1.7 release in 2008
// comment out if you need this and have JDK 1.5
// if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
// if (_readTimeout>=0) connection.setReadTimeout( _readTimeout );
if (HttpUnitOptions.isLoggingHttpHeaders()) {
String urlString = request.getURLString();
System.out.println( "\nConnecting to " + request.getURL().getHost() );
System.out.println( "Sending:: " + request.getMethod() + " " + urlString );
}
sendHeaders( connection, getHeaderFields( request.getURL() ) );
sendHeaders( connection, request.getHeaderDictionary() );
request.completeRequest( connection );
return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() );
} finally {
System.setProperties( savedProperties );
}
}
代码示例来源:origin: javanettasks/httpunit
/**
* Creates a web response object which represents the response to the specified web request.
**/
protected WebResponse newResponse( WebRequest request, FrameSelector targetFrame ) throws MalformedURLException, IOException {
Properties savedProperties = (Properties) System.getProperties().clone();
try {
if (_proxyHost != null) {
System.setProperty( "proxyHost", _proxyHost );
System.setProperty( "proxyPort", Integer.toString( _proxyPort ) );
}
URLConnection connection = openConnection( getRequestURL( request ) );
// [ 1518901 ] enable http connect and read timeouts (needs JDK 1.5)
// XXX enable for 1.7 release in 2008
// comment out if you need this and have JDK 1.5
// if (_connectTimeout>=0) connection.setConnectTimeout( _connectTimeout );
// if (_readTimeout>=0) connection.setReadTimeout( _readTimeout );
if (HttpUnitOptions.isLoggingHttpHeaders()) {
String urlString = request.getURLString();
System.out.println( "\nConnecting to " + request.getURL().getHost() );
System.out.println( "Sending:: " + request.getMethod() + " " + urlString );
}
sendHeaders( connection, getHeaderFields( request.getURL() ) );
sendHeaders( connection, request.getHeaderDictionary() );
request.completeRequest( connection );
return new HttpWebResponse( this, targetFrame, request, connection, getExceptionsThrownOnErrorStatus() );
} finally {
System.setProperties( savedProperties );
}
}
内容来源于网络,如有侵权,请联系作者删除!