Router Jockey
Router Jockey

Reputation: 79

Azure Function: how to received data via chunked encoding

All the function examples that Azure provides (for all the different supported languages) all seems to expect the input via regular ways of invoking the function via parameter=value whether its with POST or GET.

But in this case the data into the function comes in via external clients via HTTP chunked encoding (in an HTTP POST). I cant see how to implement this as how to receive the chunked data in my function?

Upvotes: 3

Views: 1978

Answers (1)

Router Jockey
Router Jockey

Reputation: 79

Well it turns out that if you use chunked encoding on a POST request into an Azure function then the get_body() call will read the length value in the chunk and strip everything out, returning only the encapsulated data. Problem solved!

Edit to add: while this works for the live production azure functions, it doesnt work for local development running functions on your local machine with VSCode

Upvotes: 5

Related Questions