Hi,

> Sounds to me like you should be routing based on the Content-Length
> header...
> Perhaps try routing based on ${HTTP_CONTENT_LENGTH} ?
Thank you for the tip, this is a clever workaround, but unfortunately
I cannot rely on it. The size of the input variables can be different,
and some methods take a variable number of input arguments. Thus, the
length of the request is not a certain predictor of the method
invoked.

The method itself is the in the very beginning of the message, so if I
could peek the first few bytes, that would be sufficient:
{'GetTelemetry': {'data': {'type': 'user', 'id':
u'25b2f369-3ca5-4cdb-ab47-abc12343231'}}}
{'TransferEnergy': {'data': {'amount': 1945, 'target':
[u'25b2f369-3ca5-4cdb-ab47-abc12343231']}}}
{'TransferEnergy': {'data': {'amount': 1945, 'target':
[u'25b2f369-3ca5-4cdb-ab47-abc12343231',
u'11111-2222-3333-4444-abc12343231']}}}

The total number of methods is less than 10, so one can tell them
apart by looking at the first 4 characters in the body.

What other options could apply?
_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to