14
Postman User Guide Document Reference: 8314 July 2017 Version: 2

Postman User Guide - IoT | Eseye Ltd€¦ · Postman User Guide Document Reference: 8314 ... 5 Returned messages ... ‘Headers’ and ‘Tests’. 5.1 Body

  • Upload
    vunhi

  • View
    224

  • Download
    4

Embed Size (px)

Citation preview

Postman User Guide

Document Reference: 8314

July 2017

Version: 2

Page 1

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

Version

Number

Date Author Changes

1 Sep 2015 Sam Smith

2 Jul 2017 Sam Smith Branding updated

Page 2

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

Contents 1 Introduction ......................................................................................................................................... 3

2 Downloading ....................................................................................................................................... 3

2.1 Google Chrome ........................................................................................................................ 3

2.2 Postman app .............................................................................................................................. 3

3 Opening Postman .............................................................................................................................. 4

3.1 As a program .............................................................................................................................. 4

3.2 As an app in Google Chrome ................................................................................................ 4

4 Functions .............................................................................................................................................. 6

4.1 Request URL ................................................................................................................................ 6

4.2 Command .................................................................................................................................. 6

4.3 Parameters .................................................................................................................................. 6

4.4 Options ........................................................................................................................................ 7

4.4.1 Authorization .......................................................................................................................... 7

4.4.2 Headers (0) ............................................................................................................................. 8

4.4.3 Body ......................................................................................................................................... 9

4.4.4 Pre-request script ................................................................................................................... 9

4.4.5 Tests .......................................................................................................................................... 9

4.5 Send ........................................................................................................................................... 10

5 Returned messages .......................................................................................................................... 11

5.1 Body ........................................................................................................................................... 11

5.2 Cookies ...................................................................................................................................... 11

5.2.1 Installation ............................................................................................................................. 11

5.2.2 Enabling................................................................................................................................. 11

5.3 Headers ..................................................................................................................................... 12

5.4 Tests ............................................................................................................................................ 12

6 Other features ................................................................................................................................... 13

Page 3

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

1 Introduction This document explains how to download and use the Postman application. The postman

application is a request builder that enables easy interaction with an API, without the need

for a detailed knowledge of the coding required.

This document is designed to be used alongside another Eseye user guide, with this

document explaining the basics of Postman and the other guide instructing what to enter

and select.

Eseye recommends Postman to be used to understand or to test API commands.

2 Downloading

2.1 Google Chrome

To download Postman use Google Chrome as the web browser. This is downloaded for free

from:

http://www.google.co.uk/intl/en_uk/chrome/browser/

2.2 Postman app

To download Postman for free go to:

https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomo

p

Postman is downloaded to work independently of any browsers.

Page 4

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

3 Opening Postman There are two ways to open Postman.

3.1 As a program

Treat it as you would any other program, for example by opening it via the Start Menu on

Windows.

3.2 As an app in Google Chrome

Open a new tab in Google Chrome. Select the Google Apps icon in the top left hand corner

of the window.

On the Google apps screen select the Postman app and logo.

Page 5

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

This will open a new window for the Postman app.

Page 6

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

4 Functions

4.1 Request URL

The Request URL is entered into the ‘Enter request URL here’ box. The relevant Eseye user

guide provide guidance on this.

4.2 Command

To the left of the ‘Enter request URL here’ box there is a dropdown menu with the options;

‘Get’, ‘Post’, ‘Put’, ‘Patch’, ‘Delete’, ‘Copy’, ‘Head’, ‘Options’, ‘Link’, ‘Unlink’, ‘Purge’, ‘Lock’,

‘Unlock’, ‘Propfind’ and ‘View’.

The relevant Eseye user guide provide guidance on this.

4.3 Parameters

To the right of the ‘Enter request URL here’ box there is a ‘Params’ button. This button reveals

a two rows below the ‘Enter request URL here’ box. The top row displays ‘Path variable key’

and ‘value’. The lower row displays ‘URL Parameter Key’ and ‘value’. To add another ‘URL

Parameter Key’ row begin to fill in the previous and one will appear below.

Page 7

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

The relevant Eseye user guide provide guidance on this.

4.4 Options

Underneath the ‘Enter request URL here’ box or the ‘URL Parameter Key’ box, if selected,

there are five options. These are ‘Authorization’, ‘Headers (0)’, ‘Body’, ‘Pre-request script’,

and ‘Tests’.

The relevant Eseye user guide provide guidance on this.

4.4.1 Authorization

Selecting reveals a drop down menu, located below the Authorization button. This drop

down menu has the options: ‘No Auth’, ‘Basic Auth’, ‘Digest Auth’, ‘OAuth 1.0’, and ‘OAuth

2.0’.

The default selection is ‘Authorization’ and ‘No Auth’.

Page 8

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

4.4.2 Headers (0)

Selecting reveals a row with the headings ‘Header’ and ‘Value’.

Page 9

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

4.4.3 Body

Body is only available as an option when using the commands: ‘Post’, ‘Put’, ‘Patch’, ‘Delete’,

‘Link’, ‘Unlink’, ‘Lock’, and ‘Propfind’.

Selecting reveals four options, these are: ‘form-data’, ‘x-www-form-urlencoded’, ‘raw’, and

‘binary’.

4.4.3.1 Form-data

Selecting reveals a row below with ‘Key’ and ‘Value’ as headings, with a dropdown menu of

text or file.

4.4.3.2 X-www-form-urlencoded

Selecting reveals a row below with ‘Key’ and ‘Value’ as headings.

4.4.3.3 Raw

Selecting reveals text box with numbered rows, and a drop down menu. The dropdown

menu includes; ‘Text’, ‘Text (text/plain)’, ‘JSON (application/json)’, ‘Javascript

(application/javascript)’, ‘XML (application/xml)’, ‘XML (text/xml)’, and ‘HTML (text/html)’.

4.4.4 Pre-request script

This is only available to paying customers of Postman, and unused by Eseye.

4.4.5 Tests

This is only available to paying customers of Postman, and unused by Eseye.

Page 10

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

4.5 Send

Use the blue send button in the top right corner of the window to send the request.

Page 11

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

5 Returned messages After pressing send on a request the Eseye API sends a return message.

This is displayed below the Options, this message can include ‘Body’, ‘Cookies’ and

‘Headers’ and ‘Tests’.

5.1 Body

This can be displayed in ‘Pretty’, ‘Raw’, and ‘Preview’.

Within ‘Pretty’ are the options for ‘HTML’, ‘JSON’, ‘XML’, and ‘Text’.

5.2 Cookies

For this function to be used, the ‘Postman Interceptor’ app needs to be installed and

enabled (as the default is not enabled).

5.2.1 Installation

To install for free go to: https://chrome.google.com/webstore/detail/postman-

interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo?hl=en

5.2.2 Enabling

After installation to turn on the application in the Postman app click on the icon of a satellite

in a circle in the top right hand corner and click the switch that appears.

When the icon is orange the ‘Cookies’ option when a request is returned should be usable.

For this function to work the ‘Postman Interceptor’ needs to be set to on in Google Chrome

(it is not the default). In Chrome click on the Interceptor icon on the right of the url bar and

ensure it looks as follows. Ensure that you have a google chrome window open when you

wish to view the cookies in Postman.

Page 12

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

5.3 Headers

This displays the headers received in row format.

5.4 Tests

This is only available to paying customers of Postman, and unused by Eseye.

Page 13

+ 44 1483 802501 | +1 512-813-0599 | +27 87 551 8200 | +33 9 87 67 53 36 | +61 8 9551 5200 | +61 400 435 1000

Eseye, AnyNet, AnyNet Secure and Eseye Logos are registered trademarks of Eseye Ltd © Eseye 2017 Limited.

All Rights Reserved. [email protected] | eseye.com

6 Other features The Postman app has a ‘History’ section that records all of the requests. It is found on the left

of the screen. It saves the requests and allows them to be reopened even if the application

has been closed since.