本文整理汇总了Python中HttpCall.callHttpPOST方法的典型用法代码示例。如果您正苦于以下问题:Python HttpCall.callHttpPOST方法的具体用法?Python HttpCall.callHttpPOST怎么用?Python HttpCall.callHttpPOST使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpCall
的用法示例。
在下文中一共展示了HttpCall.callHttpPOST方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadTemplate
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
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
示例2: createSubscription
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
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"]
示例3: createCustomer
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
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"]
示例4: getCardToken
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
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"]
示例5: makeQuery
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
def makeQuery(instanceType, case):
response = HttpCall.callHttpPOST(server, "objectology/"+instanceType+"/query", {"data":case}, contentType="application/json").strip()
null = None
instances = eval(response)
return instances
示例6: applyDelta
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
def applyDelta(instanceTypeAndId, case, contentType="text/xml"):
response = HttpCall.callHttpPOST(server, "objectology/"+instanceTypeAndId+"/", {"data":case}, contentType=contentType).strip()
return response
示例7: createInstance
# 需要导入模块: import HttpCall [as 别名]
# 或者: from HttpCall import callHttpPOST [as 别名]
def createInstance(instanceType, case, contentType="text/xml"):
response = HttpCall.callHttpPOST(server, "objectology/"+instanceType+"/", {"data":case}, contentType=contentType).strip()
return response