Book Image

Mastering ServiceStack

By : Andreas Niedermair
Book Image

Mastering ServiceStack

By: Andreas Niedermair

Overview of this book

Table of Contents (13 chapters)

Querying your service with Postman


Another approach to offer a sandbox for your API is to feed the Postman plugin of your browser with certain metadata to offer automatic discovery of your operations.

Postman is a Google Chrome plugin that can be launched as a stand-alone application to help developers work with APIs.

The corresponding feature comes shipped with ServiceStack and just needs activation in your app host's configuration.

using Funq;
using ServiceStack;

public override void Configure(Container container)
{
  this.Plugins.Add(new PostmanFeature());
}

The generated Postman collection is now available at /postman and can be added to your collections.

The Postman feature offers the following properties for adaptions, just like outer features:

  • AtRestPath (default: /postman): This lets you adapt the URL to expose the Postman collection.

  • DefaultLabelFmt (default: [type]): This lets you define a format for the title of each operation in the collection, if you do not inject a certain label...