0

JFIF 形式の写真を取得するエンドポイントに取得要求を送信する必要があります。

郵便配達員を介してエンドポイントに直接アクセスすると、すべてが期待どおりに機能し、写真は郵便配達員の本文で正しくレンダリングされます。応答ヘッダーを確認すると、content-length は 4811、content-type は「image/jpeg」です。

However, I need to access this endpoint through an express server. So I am sending a request to my express erver, when I console.log the response headers in express after sending the request from the server to the external endpoint, the headers come back matching as if it went from postman directly (content-length 4811). However, when I send this response.data back to postman from the express server, the response now has a content-length value of 7499.

It seems that express has added some data to the response body and I am guessing this is why the data isn't rendering correctly.

I cannot find a way to get the 'raw response' in Postman - it just automatically renders it as a photo so I can't compare the JFIF strings to find where the difference is.

Suggestions very welcome.

4

0 に答える 0