本文整理汇总了Python中net.grinder.plugin.http.HTTPPluginControl.getHTTPUtilities方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPPluginControl.getHTTPUtilities方法的具体用法?Python HTTPPluginControl.getHTTPUtilities怎么用?Python HTTPPluginControl.getHTTPUtilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.grinder.plugin.http.HTTPPluginControl
的用法示例。
在下文中一共展示了HTTPPluginControl.getHTTPUtilities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NVPair
# 需要导入模块: from net.grinder.plugin.http import HTTPPluginControl [as 别名]
# 或者: from net.grinder.plugin.http.HTTPPluginControl import getHTTPUtilities [as 别名]
# The Grinder 3.4
# HTTP script recorded by TCPProxy at Jan 24, 2011 1:53:12 PM
from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
from HTTPClient import NVPair
connectionDefaults = HTTPPluginControl.getConnectionDefaults()
httpUtilities = HTTPPluginControl.getHTTPUtilities()
# To use a proxy server, uncomment the next line and set the host and port.
# connectionDefaults.setProxyServer("localhost", 8001)
# These definitions at the top level of the file are evaluated once,
# when the worker process is started.
connectionDefaults.defaultHeaders = \
[ NVPair('Accept-Language', 'en-us,en;q=0.5'),
NVPair('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'),
NVPair('Accept-Encoding', 'gzip,deflate'),
NVPair('User-Agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13'), ]
headers0= \
[ NVPair('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'), ]
headers1= \
[ NVPair('Accept', 'image/png,image/*;q=0.8,*/*;q=0.5'),
NVPair('Referer', 'http://localhost:8000/oib/login'), ]
headers2= \
[ NVPair('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),