This repository was archived by the owner on Jan 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ def refresh_token(self, force_refresh = False):
177177 """
178178 #If we don't already have a token or the token expires within 5 min(300 seconds), get one
179179 if (force_refresh or self .authToken is None or (self .authTokenExpiration is not None and time .time () + 300 > self .authTokenExpiration )):
180- headers = {'content-type' : 'application/json' }
180+ headers = {'content-type' : 'application/json' , 'user-agent' : 'FuelSDK-Python' }
181181 if (self .authToken is None ):
182182 payload = {'clientId' : self .client_id , 'clientSecret' : self .client_secret , 'accessType' : 'offline' }
183183 else :
@@ -205,7 +205,7 @@ def determineStack(self):
205205 find the correct url that data request web calls should go against for the token we have.
206206 """
207207 try :
208- r = requests .get ('https://www.exacttargetapis.com/platform/v1/endpoints/soap?access_token=' + self .authToken )
208+ r = requests .get ('https://www.exacttargetapis.com/platform/v1/endpoints/soap?access_token=' + self .authToken , { 'user-agent' : 'FuelSDK-Python' })
209209 contextResponse = r .json ()
210210 if ('url' in contextResponse ):
211211 return str (contextResponse ['url' ])
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ class ET_PostRest(ET_Constructor):
349349 def __init__ (self , auth_stub , endpoint , payload ):
350350 auth_stub .refresh_token ()
351351
352- headers = {'content-type' : 'application/json' }
352+ headers = {'content-type' : 'application/json' , 'user-agent' : 'FuelSDK-Python' }
353353 r = requests .post (endpoint + '?access_token=' + auth_stub .authToken , data = json .dumps (payload ), headers = headers )
354354
355355 obj = super (ET_PostRest , self ).__init__ (r , True )
@@ -364,7 +364,7 @@ class ET_PatchRest(ET_Constructor):
364364 def __init__ (self , auth_stub , endpoint , payload ):
365365 auth_stub .refresh_token ()
366366
367- headers = {'content-type' : 'application/json' }
367+ headers = {'content-type' : 'application/json' , 'user-agent' : 'FuelSDK-Python' }
368368 r = requests .patch (endpoint + '?access_token=' + auth_stub .authToken , data = json .dumps (payload ), headers = headers )
369369
370370 obj = super (ET_PatchRest , self ).__init__ (r , True )
You can’t perform that action at this time.
0 commit comments