gabriel / as3httpclient

HTTP Client for AS3
MIT License
243 stars 76 forks source link

POST fails with ByteArray body with position != 0 #7

Open petergeneric opened 12 years ago

petergeneric commented 12 years ago

When making a POST request, if the request.body is a ByteArray and the array is not at position 0 the request fails.

This looks to be because the Content-Length header is set based on the .length of the body, however during transport it expects there to be .length bytes of data after the current position. It would at least be worth a warning in the documentation for HttpRequest (or possibly changing the code to generate Content-Length using .bytesAvailable instead of .length?)