Closed sohailgerman closed 8 years ago
I think your input is invalid json. see --48940923NODERESLTER3890457293
, not key-value format.
It is not JSON format it is in the form of multipart/form-data format which is received from post request from another server.
There's no built-in support for forms in Elli. As you see, it just gives you the body and it's up to you to make the decision of how to parse it.
Here's a library for parsing multipart forms: https://github.com/mme/erlmultipart I've never used this myself and don't know how complete it is, but maybe it's worth a shot.
I get this binary string in request and need to convert it to JSON Format
<<"--48940923NODERESLTER3890457293\r\nContent-Disposition: form-data; name=\"CallSid\"\r\n\r\n4025beb07e1faac824c6b2f9e22e0b5f\r\n--48940923NODERESLTER3890457293\r\nContent-Disposition: form-data; name=\"Status\"\r\n\r\nfailed\r\n--48940923NODERESLTER3890457293\r\nContent-Disposition: form-data; name=\"DateUpdated\"\r\n\r\n2016-11-07 16:01:40\r\n--48940923NODERESLTER3890457293--\r\n">>