def parse_hook_payload(request):
 if (request.META['CONTENT_TYPE'] == 'application/json'):
  return json.loads(request.body.decode('utf-8'))
 else:
  return json.loads(request.POST['payload'])

def parse_hook_payload ( request ) : if ( request . META [ 'CONTENT_TYPE' ] == 'application/json' ) : return json . loads ( request . body . decode ( 'utf-8' ) ) else : return json . loads ( request . POST [ 'payload' ] )
parses hook payload .