mockserver
mockserver copied to clipboard
Any way to serve binary content types such as PDF?
Just found this and it's so easy to use! I was wondering how easy it is to mock non-ascii content types. I played with mocks using PDF content with the following headers
HTTP/1.1 200 OK
Content-Type: application/pdf
followed by a blank line and then the PDF content but it rendered an empty PDF content. Only 200+ bytes were sent. Wondering if anyone's encountered that before?
Hi @jameschao,
to be fair we've never needed something as such, so it probably doesn't work :) PRs are welcome even though I don't know if you'd really need to test the content of the PDF. So, for example, you can still let your app work by downloading an "empty" PDF -- considering this module is only used for testing you wont really have to check that the PDF itself is readable :)
Hi @odino there are other use cases for testing a different bunch of stuff, i.e. we're currently testing a client that needs to also deal with pdf resources in a particular fashion