Closed fmmattioni closed 2 years ago
Hi @fmmattioni. This sounds like an interesting use case! Is lambdr
struggling to parse the event body?
Indeed.. the data is passed as binary, would that be an issue for {lambdr}
?
Not a problem! If you use an identity
deserialiser, your handler function will receive the raw event body as is. The deserialiser
is responsible for converting the event body into something that the handler function can process. Normally it turns JSON into an R list, which is passed to the handler function as arguments. But in this case we'd rather use the identity
function to make the deserialiser leave the event body alone. It would then be up to your handler function to deal with the binary data. Example:
start_lambda(
config = lambda_config(deserialiser = identity)
)
Please let me know if that doesn't work!
OMG this worked like a charm! I guess the issue was that I literally did not know what the identity
function was.. thank you so much!
Hey @mdneuzerling,
I have been trying to get a function to work that handles a POST request that has a file (FormData) in its body. This is the header that I is passed in the request:
What would you recommend me to do in this case? If it helps, I can quickly create a repo as a reprex.
Thanks in advance!