Grégory C
Grégory C

Reputation: 429

Why Postman return unminified JSON Response?

I am new with Postman. For testing purpose, I send a GET call on openweathermap.org API and I well receive a JSON response.

The problem is that the Json response body is minified and not easily readable as show in below example.

{"coord":{"lon":2.35,"lat":48.85},"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"base":"stations","main":{"temp":286.13,"feels_like":283.45,"temp_min":285.37,"temp_max":287.04,"pressure":1011,"humidity":84},"visibility":10000,"wind":{"speed":4.02,"deg":43,"gust":9.39},"clouds":{"all":84},"dt":1603881793,"sys":{"type":3,"id":2012208,"country":"FR","sunrise":1603866690,"sunset":1603903021},"timezone":3600,"id":2988507,"name":"Paris","cod":200}

Changing between Pretty / Raw tabs doesn't change anything, nor forcing JSON format in Pretty tab. In response headers, Content-Type : application/json is well present.

On a own developped API, the Json response body is well unminified so I don't understand what could be the issue.

Is anybody faced the same problem and found a solution ? Thanks in advance

Additionnal information : I use Postman for Web with Desktop agent. Version 7.34.1-prod201020-0443 Chrome 85 / Windows 8

Upvotes: 4

Views: 6135

Answers (2)

Dipen Shah
Dipen Shah

Reputation: 26075

As mentioned by G.Dimov, the issue is related to Postman. Also, current stable production version of Postman for Windows is 7.34.0.

Most likely you are using Canary build which could be non stable.

Upvotes: 0

G.Dimov
G.Dimov

Reputation: 2393

I've just tested and the response JSON is well-formatted and beautified. I am using Postman desktop version v7.34.0 on Windows 10.

Created an API key for api.openweathermap.org and I send the request like that:

  • GET request
  • URL: api.openweathermap.org/data/2.5/weather?q=Paris,fr&appid={{openWeatherAPIkey}} testing with Paris as a city, based on your response JSON.
  • One header Accept: application/json.

The response is:

{
    "coord": {
        "lon": 2.35,
        "lat": 48.85
    },
    "weather": [
        {
            "id": 800,
            "main": "Clear",
            "description": "clear sky",
            "icon": "01d"
        }
    ],
    "base": "stations",
    "main": {
        "temp": 289.9,
        "feels_like": 287.87,
        "temp_min": 289.15,
        "temp_max": 290.93,
        "pressure": 1017,
        "humidity": 77
    },
    "visibility": 10000,
    "wind": {
        "speed": 4.1,
        "deg": 190
    },
    "clouds": {
        "all": 0
    },
    "dt": 1604152275,
    "sys": {
        "type": 1,
        "id": 6550,
        "country": "FR",
        "sunrise": 1604126177,
        "sunset": 1604161918
    },
    "timezone": 3600,
    "id": 2988507,
    "name": "Paris",
    "cod": 200
}

enter image description here

If you have tried all that and the problem still persists, probably it's a bug. I've went through all Postman settings and there is nothing possible to cause the issues.

The only difference is at the time of that writing the last Postman version is: v7.34.0

enter image description here

Upvotes: 2

Related Questions