开发者

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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜