1

I have a new caller who can call my application only in a specific new url pattern:-

applicationpath?send=N&msg=<MessageContent>&dest=<PHONE>&stime=MM/DD/YY HH:MM:SS PM/AM&Operator=P&Circle=Q

My existing urlconf calls different methods based on the message text:-

(('api/(?P<phone>\w+)/MessageA', handle_a_message),
 ('api/(?P<phone>\w+)/MessageB', handle_b_message),
  ...)

I can think of writing another urlconf that redirects to these methods along these lines:-

(('applicationpath?send=N&msg=MessageA&dest=(?P<phone>\w+)/\w+', handle_a_message),
 ('applicationpath?send=N&msg=MessageB&dest=(?P<phone>\w+)/\w+', handle_b_message),
 ...)

Are there simpler recommended alternatives I am missing? Is redirection the best alternative?

Himanshu
  • 2,384
  • 2
  • 24
  • 42

0 Answers0