示例#1
0
def buildRequestXml(itemID):

    appID,devID,certID,userToken=get_id("production")    
    requestXml = "<?xml version='1.0' encoding='utf-8'?>"+\
              "<GetItemRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">"+\
              "<RequesterCredentials><eBayAuthToken>" + userToken + "</eBayAuthToken></RequesterCredentials>" + \
              "<IncludeItemSpecifics>True</IncludeItemSpecifics>"+\
              "<DetailLevel>ItemReturnAttributes</DetailLevel>"+\
              "<ItemID>" + itemID + "</ItemID>"+\
              "<WarningLevel>High</WarningLevel>"+\
              "</GetItemRequest>"
    return requestXml
示例#2
0
def buildHttpHeaders():

    appID,devID,certID,userToken=get_id("production")
    compatabilityLevel="679"
    siteID=0
    verb="GetItem"
    httpHeaders = {"X-EBAY-API-COMPATIBILITY-LEVEL": compatabilityLevel,    
               "X-EBAY-API-DEV-NAME": devID,
               "X-EBAY-API-APP-NAME": appID,
               "X-EBAY-API-CERT-NAME": certID,
               "X-EBAY-API-CALL-NAME": verb,
               "X-EBAY-API-SITEID": siteID,
               "Content-Type": "text/xml"}
    return httpHeaders