# Postman Response format from RAW to Base64

**URL:** <https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291>\
**Category:** Help Hub\
**Tags:** response, postman-api\
**Created:** [March 2, 2025, 11:15pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291 "2025-03-02T23:15:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![epraj94](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@epraj94](https://community.postman.com/u/epraj94)\
**Post date:** [March 2, 2025, 11:15pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/1 "2025-03-02T23:15:28Z")

</div>

I’m receiving the response from an API using java, and I’m receiving ‘Raw’ format type as the response. However when I’m using Postman, I’m able to receive the response in 3 formats and able to switch between the formats. Attaching the screenshot.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/a/a/aa5f365c9418e5682848cfd3a7dd922819de347e.png)

I need a solution for changing the response type and to receive the response in Base64 format using the Java code.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [March 3, 2025, 12:03pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/2 "2025-03-03T12:03:53Z")

</div>

Hey @epraj94 👋

Welcome to the Postman Community! :postman:

What `content-type` header are you setting in the code? Are you setting a _base64_ header?

The response in Postman would be based on the response header from the endpoint.

---

<div class="post-metadata">

**Author:** ![epraj94](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@epraj94](https://community.postman.com/u/epraj94)\
**Post date:** [March 3, 2025, 12:55pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/3 "2025-03-03T12:55:05Z")

</div>

> [@danny-dainton](#):
>
> base64

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/8/88ef07f281b16e107be106b86552c20aadef0166.png)

Before I didn’t mention the content-type, now I have added content-type as base64, hence receiving the same response. I tried in my java code as well, still receiving the RAW data.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [March 3, 2025, 2:14pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/4 "2025-03-03T14:14:26Z")

</div>

Wouldn’t you need to add that header to the implementation so the server knows that the response should server it as that content type?

What are the response headers for your request?

---

<div class="post-metadata">

**Author:** ![epraj94](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@epraj94](https://community.postman.com/u/epraj94)\
**Post date:** [March 3, 2025, 2:33pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/5 "2025-03-03T14:33:57Z")

</div>

![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/a/3aced6fae257972a9189e063df93f0bf7372680a.png)

these are the response headers for my request.

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [March 3, 2025, 8:27pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/6 "2025-03-03T20:27:51Z")

</div>

Hey @epraj94, the API you are calling is returning the response in that format. Is that an API you created? If so, you would need to update the implementation to return the binary data as base64 encoding.

If you don’t own that API, maybe you can look at the docs and see if they have a flag or parameter you can provide to change the response type.

---

<div class="post-metadata">

**Author:** ![deepan193](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@deepan193](https://community.postman.com/u/deepan193)\
**Post date:** [March 4, 2025, 1:12pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/7 "2025-03-04T13:12:45Z")

</div>

Hey @epraj94 , From your response Header it seems like you are receiving image/jpeg. I dont think you can convert or validate the received raw image content.

Please elobrate on what exactly you are looking for.

---

<div class="post-metadata">

**Author:** ![epraj94](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@epraj94](https://community.postman.com/u/epraj94)\
**Post date:** [March 5, 2025, 5:33pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/8 "2025-03-05T17:33:06Z")

</div>

> [@deepan193](#):
>
> you can convert or validate the received raw image content.
> 
> Please elobrate on what exactly you are looking for.

I need to download the data in Base64 format

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [March 7, 2025, 3:15pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/9 "2025-03-07T15:15:37Z")

</div>

I don’t want to leave you without an answer, @epraj94. Could you answer my questions from a few days ago so we can get you past this?

---

<div class="post-metadata">

**Author:** ![epraj94](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@epraj94](https://community.postman.com/u/epraj94)\
**Post date:** [March 7, 2025, 7:10pm UTC](https://community.postman.com/t/postman-response-format-from-raw-to-base64/76291/10 "2025-03-07T19:10:00Z")

</div>

> [@allenheltondev](#):
>
> API you are calling is returning the response in that format. Is that an API you created? If so, you would need to update the implementation to return the binary data as base64 encoding.
> 
> If you don’t own that API, maybe you can look at the docs and see if they have a flag or parameter you can provide to change the response type.

I don’t own that API. Its an external API, and I’m consuming that API. I have also checked the docs, where they were not having any flags to change the format type. It seems I need to download the data as a file and convert it into Base64 format.
