File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ def refresh_token(self, force_refresh = False):
177
177
"""
178
178
#If we don't already have a token or the token expires within 5 min(300 seconds), get one
179
179
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' }
181
181
if (self .authToken is None ):
182
182
payload = {'clientId' : self .client_id , 'clientSecret' : self .client_secret , 'accessType' : 'offline' }
183
183
else :
@@ -205,7 +205,7 @@ def determineStack(self):
205
205
find the correct url that data request web calls should go against for the token we have.
206
206
"""
207
207
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' })
209
209
contextResponse = r .json ()
210
210
if ('url' in contextResponse ):
211
211
return str (contextResponse ['url' ])
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ class ET_PostRest(ET_Constructor):
349
349
def __init__ (self , auth_stub , endpoint , payload ):
350
350
auth_stub .refresh_token ()
351
351
352
- headers = {'content-type' : 'application/json' }
352
+ headers = {'content-type' : 'application/json' , 'user-agent' : 'FuelSDK-Python' }
353
353
r = requests .post (endpoint + '?access_token=' + auth_stub .authToken , data = json .dumps (payload ), headers = headers )
354
354
355
355
obj = super (ET_PostRest , self ).__init__ (r , True )
@@ -364,7 +364,7 @@ class ET_PatchRest(ET_Constructor):
364
364
def __init__ (self , auth_stub , endpoint , payload ):
365
365
auth_stub .refresh_token ()
366
366
367
- headers = {'content-type' : 'application/json' }
367
+ headers = {'content-type' : 'application/json' , 'user-agent' : 'FuelSDK-Python' }
368
368
r = requests .patch (endpoint + '?access_token=' + auth_stub .authToken , data = json .dumps (payload ), headers = headers )
369
369
370
370
obj = super (ET_PatchRest , self ).__init__ (r , True )
You can’t perform that action at this time.
0 commit comments