from tyk.decorators import *

@Pre
def AddSomeHeader(request, session):
    # request['Body'] = 'tyk=python'
    request['SetHeaders']['SomeHeader'] = 'python2'
    return request, session

def NotARealHandler():
    pass

from tyk.decorators import *
from tyk.gateway import TykGateway as tyk

@Pre
def AddSomeHeader(request, session):
    request['SetHeaders']['SomeHeader'] = 'python'
    tyk.store_data( "cool_key", "cool_value", 300 )
    return request, session

def NotARealHandler():
    pass

Update middleware syntax with "TykGateway"
Update middleware syntax with "TykGateway"

  from tyk.decorators import *
+ from tyk.gateway import TykGateway as tyk
  
  @Pre
  def AddSomeHeader(request, session):
-     # request['Body'] = 'tyk=python'
-     request['SetHeaders']['SomeHeader'] = 'python2'
+     request['SetHeaders']['SomeHeader'] = 'python'
+     tyk.store_data( "cool_key", "cool_value", 300 )
      return request, session
  
  def NotARealHandler():
      pass
  
Update middleware syntax with "TykGateway"
## Code Before:
from tyk.decorators import *

@Pre
def AddSomeHeader(request, session):
    # request['Body'] = 'tyk=python'
    request['SetHeaders']['SomeHeader'] = 'python2'
    return request, session

def NotARealHandler():
    pass

## Instruction:
Update middleware syntax with "TykGateway"
## Code After:
from tyk.decorators import *
from tyk.gateway import TykGateway as tyk

@Pre
def AddSomeHeader(request, session):
    request['SetHeaders']['SomeHeader'] = 'python'
    tyk.store_data( "cool_key", "cool_value", 300 )
    return request, session

def NotARealHandler():
    pass
