JKI HTTP REST Client
JKI HTTP REST Client is a HTTP client library for connecting LabVIEW applications with RESTful web services. JKI HTTP REST Client provides a client implementation of HTTP protocol that is specifically designed for integrating LabVIEW applications with web services. JKI REST Client augments the LabVIEW native implementation of HTTP by adding several features that make it better fit for connecting with RESTful web services than LabVIEW native HTTP client.
Want to discuss the JKI HTTP Rest Client? Join the community discussion forum, here.
Installation
You can download and install JKI REST Client with VI Package Manager.
Usage
JKI REST Client is a LabVIEW toolkit providing a library of VIs for connecting LabVIEW applications with REST based web services.
Palette
To use JKI REST Client, you need to drop the corresponding JKI REST Client VIs to the block diagrams. The JKI REST Client VIs are located under the JKI Tools functions palette menu.
Basic Workflow
The toolkit provides a VI for connecting LabVIEW applications with RESTful web services. The basic workflow is presented in the image below.
API Reference
Main Palette
Create REST Client
Create REST Client creates an instance of the client.
The VI provides multiple arguments for defining how to create the JKI REST Client instance.
Base URL specifies the base URL to be used for the HTTP requests.
Escape URLs when true instruct the REST Client to escape all URLs before executing the requests. If you have already escaped the URLs, set this to false.
Authentication allows setting the username and password for services that use HTTP authentication.
Verify Server when true instructs the REST Client to validate the certificate of the server when HTTPS protocol is being used.
Default Headers specifies an array of headers to be used with every requests. Defaults to application/json content type.
Cookie File specifies a file path to be used for cookies.
HTTP HEAD
Performs a HTTP HEAD Request.
The VI provides multiple arguments for defining how to perform the HTTP request.
Path specifies the path beneath the Base URL to be used for the HTTP request.
request specific headers specifies an array of headers to be used with this particular HTTP request. The Default Headers specified upon creation of the JKI REST Client together with the request specific headers will all be used for the HTTP request.
HTTP GET
Performs a HTTP GET Request.
The VI provides multiple arguments for defining how to perform the HTTP request.
Path specifies the path beneath the Base URL to be used for the HTTP request.
request specific headers specifies an array of headers to be used with this particular HTTP request. The Default Headers specified upon creation of the JKI REST Client together with the request specific headers will all be used for the HTTP request.
HTTP POST
Performs a HTTP POST Request.
The VI provides multiple arguments for defining how to perform the HTTP request.
Path specifies the path beneath the Base URL to be used for the HTTP request.
Request body specifies the body of the request to be send to the server.
request specific headers specifies an array of headers to be used with this particular HTTP request. The Default Headers specified upon creation of the JKI REST Client together with the request specific headers will all be used for the HTTP request.
HTTP PUT
Performs a HTTP PUT Request.
The VI provides multiple arguments for defining how to perform the HTTP request.
Path specifies the path beneath the Base URL to be used for the HTTP request.
Request body specifies the body of the request to be send to the server.
request specific headers specifies an array of headers to be used with this particular HTTP request. The Default Headers specified upon creation of the JKI REST Client together with the request specific headers will all be used for the HTTP request.
HTTP DELETE
Performs a HTTP DELETE Request.
The VI provides multiple arguments for defining how to perform the HTTP request.
Path specifies the path beneath the Base URL to be used for the HTTP request.
request specific headers specifies an array of headers to be used with this particular HTTP request. The Default Headers specified upon creation of the JKI REST Client together with the request specific headers will all be used for the HTTP request.
Destroy REST Client
Closes REST Client instance and closes up all open HTTP connections.
Response Headers Palette
Get Header By Name
Gets a response HTTP header value by name.
The VI provides the following arguments.
Name specifies the name of the HTTP header to get.
Get All Headers
Gets all response HTTP headers.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
To contribute to JKI REST Client, you will need 32-bit LabVIEW 2013 f2 professional development environment.
Credits
JKI REST Client is an open source project maintained by JKI.
License
JKI REST Client is distributed under the open source three clause BSD license providing everyone right to use and distribute both souce code and compiled versions of JKI REST Client. See LICENSE.md file for details.