4

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

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Grégory C
  • 419
  • 2
  • 7
  • 23
  • Postman is just returning what's send back from the server - Do you own the API that you're seeing this on? Is the same response shown on the desktop app? – Danny Dainton Oct 28 '20 at 13:42
  • No I don't owe the API showing this problem. On a Postman screenshot for this API, Postman is well unminifying JSON data. I am really surprised not having the same ... Thanks for your contribution. – Grégory C Oct 28 '20 at 13:59
  • You could try looking at the Postman general settings to choose to response language and set to JSON to see it that changes anything. Without more context about the request, it's tough to suggest anything else. – Danny Dainton Oct 28 '20 at 14:19
  • Yes it well returns the Content-Type : application/json, I already tried to set language JSON but nothing changes. It is really weird – Grégory C Oct 28 '20 at 14:23

2 Answers2

2

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

G.Dimov
  • 2,173
  • 3
  • 15
  • 40
  • 1
    The test you have done at least proves that the problem doesn't come from the website receiving the request, but rather from my side (Windows version or Postman version). Interesting. Thanks for the time you spent ;-) – Grégory C Oct 31 '20 at 14:14
  • 1
    No problem, glad it helped :) the only difference between my result and yours is indeed the version. – G.Dimov Oct 31 '20 at 15:44
0

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.

Dipen Shah
  • 25,562
  • 1
  • 32
  • 58