What is a binary encoded PDF?
I am currently trying to connect to a REST Api which isn't documented very well. I need to Upload a PDF to a specific URL using the Http POST Request.
The Api documentation says:
POST to this request with a binary encoded pdf.
It doesn't work and I wonder what they mean by "binary encoded pdf".
What I did was:
$pdf = base64_encode(file_get_contents("test.pdf"));
$result = $restClient->post('/api/upload/', $pdf);
Result:
400 - Bad Request
Note: The REST Client works for all other requests. I just don't seem to know what is meant by "binary encoded".
Http Header "Content-type" is also correctly set to "application/pdf"开发者_StackOverflow中文版
Sounds like a strange way to say "as is - do not encode with base64".
精彩评论