Set Up Your Environment

Since Nexusguard APIs are provided in HTTPS, any script code or senior languages is available with a http call.In this part, we will provide some code sample for local Eviroment.

Install cURL

$ sudo apt-get curl

Install PHP/Python CURL plugin.

The second option is a local PHP/Python installation. If you’ve already got PHP/Python on your system this is definitely your best option. This section describes the steps needed to work with the APIs on the command line or using our sample code.

Local Python Installation

You need the following tools in order to work with the APIs from your native OS:

Developer Tools:

Once you’re ready, you can either use HTTPie, a command-line utility, or pull the git repository and work with the code samples.

HTTPie

If you’ve installed Python 2.7.9 or later, you already have pip installed. You can install HTTPie using pip quite easily. If you don’t have pip already it’s relatively easy to install this package manager.

# Make sure we have an up-to-date version of pip and setuptools:
pip install --upgrade pip setuptools

pip install --upgrade httpie

If pip installation fails for some reason, you can try easy_install httpie as a fallback.

Development version

The latest development version can be installed directly from GitHub:

# Mac OS X via Homebrew
brew install httpie --HEAD

# Universal
pip install --upgrade 
https://github.com/jkbrzt/httpie/archive/master.tar.gz

Python version

Although Python 2.6 and 2.7 are supported as well, it is recommended to install HTTPie against the latest Python 3.x whenever possible. That will ensure that some of the newer HTTP features, such as SNI (Server Name Indication), work out of the box. Python 3 is the default for Homebrew installations starting with version 0.9.4. To see which version HTTPie uses, run http —debug.