Announcing Increased Visibility of Invalid Whitespaces and Newlines In Your API Requests

Avatar

There’s a myriad of things that can go wrong when trying to make a single API request, let alone the hundreds or even thousands of requests that the average developer needs to make in a given week. In listening to the Postman community, it’s clear that some of the most frequently experienced problems in any given API request stem from illegal whitespace and newline characters in the path, parameter, or other parts of the request.

Historically, Postman has automatically done a lot of the cleanup in these instances. But our team has come to realize that with every quick fix to whitespace and newline characters, we were making assumptions that we maybe shouldn’t have been making about what your desired outcomes might be; plus, with each of those assumptions we’ve been moving away from our commitment to making API requests more visible for you. We believe deeply in the importance of broadening our user’s understanding of what’s happening under the hood of each API request that they execute, and that’s why we’ve decided to refocus our approach to these whitespace and newline issues. Moving forward, the Postman app will now highlight the problems for you—instead of doing any automatic cleanup—so that you can grow your awareness of existing issues and make adjustments on your own and as you desire.

Five areas of visibility

Typically, when whitespace and newline characters cause an API request to fail,  the only visibility into the failure’s root cause is a cryptic (or just plain unhelpful) API error response. Rather than fixing or obfuscating these illegal whitespace and newline characters in the request, the Postman app will now make sure they’re visible to you across five main areas of each request:

  • Request Method: Historically, Postman has sent HTTP methods “as-is,” but moving forward, whitespace and newline characters will be highlighted.
  • Request URL: In the past, whitespaces were URL encoded, and newlines were trimmed, but now they will both only be highlighted for easy visibility.
  • Request Parameters: With parameters, Postman would automatically try to make assumptions on key-value pairs, but going forward, we’ll bring them to your attention.
  • HTTP Request Headers: The Postman app has never allowed whitespace and newline characters in headers, but now it’ll be bringing them to your attention for fixing.
  • Request Body: Previously, Postman would send the body through “as-is,” but it will now highlight whitespace and newline characters in the body.

Visibility builds skills and trust

Whitespace and newline character highlighting is available in the latest version of Postman, bringing you a new level of visibility. Keep an eye out as you are crafting and troubleshooting each of your API requests; you might notice some of these subtle new changes. Hopefully, these enhancements help further build trust that Postman is always looking for ways to make you aware of what’s happening with all of your API requests, while also  allowing you to more quickly debug what actually needs to be fixed—making you a more successful API developer along the way!

What do you think about this topic? Tell us in a comment below.

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.