当前位置: 首页>>代码示例>>Python>>正文


Python HttpCall类代码示例

本文整理汇总了Python中HttpCall的典型用法代码示例。如果您正苦于以下问题:Python HttpCall类的具体用法?Python HttpCall怎么用?Python HttpCall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HttpCall类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: latestUserCase

def latestUserCase(account, user, transformer=None):
    retrieveData = {"ruleSet":"ECBase", "userId":user}
    params = {"account":account}
    if transformer !=None:
        params["transformer"]=transformer
    res = HttpCall.callHttpGET(uri, service+"/"+retrieveData["ruleSet"]+"/userId/"+retrieveData["userId"]+"/latest", params).strip()
    return "["+res+"]"
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:7,代码来源:testOddball-ec.py

示例2: latestSessionCase

def latestSessionCase(account, session, transformer=None):
    params = {"account":account}
    if transformer !=None:
        params["transformer"]=transformer
    retrieveData = {"ruleSet":"ECBase", "sessionId":session}
    res = HttpCall.callHttpGET(uri, service+"/"+retrieveData["ruleSet"]+"/sessionId/"+retrieveData["sessionId"]+"/latest", params).strip()
    return "["+res+"]"
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:7,代码来源:testOddball-ec.py

示例3: users

def users(account, recent=None):
    retrieveData = {"ruleSet":"ECBase"}
    params = {"account":account}
    if recent!=None:
        params["recent"]=recent
    res = HttpCall.callHttpGET(uri, service+"/"+retrieveData["ruleSet"]+"/userId/", params).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:7,代码来源:testOddball-ec.py

示例4: binCases

def binCases(account, bin, transformer=None):
    retrieveData = {"ruleSet":"ECBase","bin":bin}
    params = {"account":account}
    if transformer !=None:
        params["transformer"]=transformer
    res = HttpCall.callHttpGET(uri, service+"/"+retrieveData["ruleSet"]+"/bin/"+retrieveData["bin"],params).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:7,代码来源:testOddball-ec.py

示例5: accountCases

def accountCases(account):
    retrieveData = {"ruleSet": "ECBase"}
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/case", {
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:7,代码来源:testOddball-ec.py

示例6: sessionCases

def sessionCases(account, session):
    retrieveData = {"ruleSet": "ECBase", "sessionId": session}
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/sessionId/" +
        retrieveData["sessionId"], {
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:8,代码来源:testOddball-ec.py

示例7: queryPlatform

def queryPlatform(account, platform):
    retrieveData = {
        "ruleSet": "ECBase",
        "query": '{ "case.device.platform": ' + platform + ' }'
    }
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/query/", {
            "query": retrieveData["query"],
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:11,代码来源:testOddball-ec.py

示例8: query2

def query2(account):
    retrieveData = {
        "ruleSet": "ECBase",
        "query": '{ "tags": "WinXX", "case.userId" : "mikeytest"}'
    }
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/query/", {
            "query": retrieveData["query"],
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:11,代码来源:testOddball-ec.py

示例9: query1

def query1(account):
    retrieveData = {
        "ruleSet": "ECBase",
        "query": '{ "case.browser": "firefox" }'
    }
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/query/", {
            "query": retrieveData["query"],
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:11,代码来源:testOddball-ec.py

示例10: loadTemplate

def loadTemplate(case, name="", uid="", trace=0):
    contextExtension = ""
    if (uid!=""):
        contextExtension=uid
    if (name!=""):
        contextExtension="name/"+name
    if trace:
        print case
        print name
        print uid
    response = HttpCall.callHttpPOST(server, "objectology/template/"+contextExtension, {"data":case}).strip()
    return response
开发者ID:revolutionarysystems,项目名称:common-test,代码行数:12,代码来源:o_utils.py

示例11: createSubscription

def createSubscription(customerId):
    service = "/customers/"+customerId+"/subscriptions"
    params = {
                "plan":"eCKB-t",
             }
    res = HttpCall.callHttpPOST(uri, service, params, contentType=None, username="sk_test_4qo3vbZaV6CI9l3ITyox2St3")
    res2 = res.replace("\r", "")
    null=None
    false=0
    true=1
    dict = eval(res2)
    return dict["id"]
开发者ID:revolutionarysystems,项目名称:o-test,代码行数:12,代码来源:testStripe.py

示例12: queryRecent

def queryRecent(account, mins):
    mins_ago = Date().getTime() - mins * 60 * 1000
    retrieveData = {
        "ruleSet": "ECBase",
        "query": '{ "timeStamp": { "$gt": "' + str(mins_ago) + '"} }'
    }
    print retrieveData["query"]
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/query/", {
            "query": retrieveData["query"],
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:13,代码来源:testOddball-ec.py

示例13: createCustomer

def createCustomer():
    service = "/customers"
    params = {
                "card":getCardToken(),
                "description":"test example for revsys",
             }
    res = HttpCall.callHttpPOST(uri, service, params, contentType=None, username="sk_test_4qo3vbZaV6CI9l3ITyox2St3")
    res2 = res.replace("\r", "")
    null=None
    false=0
    true=1
    dict = eval(res2)
    return dict["id"]
开发者ID:revolutionarysystems,项目名称:o-test,代码行数:13,代码来源:testStripe.py

示例14: getCardToken

def getCardToken():
    service = "/tokens"
    params = {
                "card[number]":"4242424242424242",
                "card[exp_month]":"12",
                "card[exp_year]":"2015",
                "card[cvc]":"123",
             }
    res = HttpCall.callHttpPOST(uri, service, params, contentType=None, username="sk_test_4qo3vbZaV6CI9l3ITyox2St3")
    res2 = res.replace("\r", "")
    null=None
    false=0
    true=1
    cardDict = eval(res2)
    return cardDict["id"]
开发者ID:revolutionarysystems,项目名称:o-test,代码行数:15,代码来源:testStripe.py

示例15: query3

def query3(account):
    mins_ago = Date().getTime() - 18 * 60 * 1000
    retrieveData = {
        "ruleSet":
        "ECBase",
        "query":
        '{ "tags": "WinXX", "case.userId" : "mikeytest", "timeStamp": { "$gt": "'
        + str(mins_ago) + '"} }'
    }
    res = HttpCall.callHttpGET(
        uri, service + "/" + retrieveData["ruleSet"] + "/query/", {
            "query": retrieveData["query"],
            "account": account
        }).strip()
    return res
开发者ID:revolutionarysystems,项目名称:oddball-test,代码行数:15,代码来源:testOddball-ec.py


注:本文中的HttpCall类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。