@register('http')
def _check_http(brain, match_kind, match, target_dict, cred_dict):
 url = ('http:' + (match % target_dict))
 data = {'target': jsonutils.dumps(target_dict), 'credentials': jsonutils.dumps(cred_dict)}
 post_data = urllib.urlencode(data)
 f = urllib2.urlopen(url, post_data)
 return (f.read() == 'True')

@ register ( 'http' ) def _check_http ( brain , match_kind , match , target_dict , cred_dict ) : url = ( 'http:' + ( match % target_dict ) ) data = { 'target' : jsonutils . dumps ( target_dict ) , 'credentials' : jsonutils . dumps ( cred_dict ) } post_data = urllib . urlencode ( data ) f = urllib2 . urlopen ( url , post_data ) return ( f . read ( ) == 'True' )
check http: rules by calling to a remote server .