Use the Restclient tool to test the RESTful services interface under Linux __linux

Source: Internet
Author: User

Originally always use Restclient-ui tool, is the graphical interface, the operation is very troublesome. Want to use Shell script batch call to execute use case, so find Restclient tool has no command line, the Internet search, sure enough. The download address is: Http://code.fosshub.com/WizToolsorg-RESTClient/downloads.

How to call it. Search for a moment, the original to do so, if the installation of Java.

  Java-jar restclient-cli-3.1-jar-with-dependencies.jar-o $rcs _dir $rcq _file

(where $rcs_dir is the response file. RCS storage path, $rcq _file is the request file. rcq file. Request file. Rcq can be generated from the UI tool. )

The tool can be executed, and the use case script needs to view the response message. Find the. rcs file from just the response directory, find the response message structure, and find that there is a string of encrypted text between <body>. To decrypt.

What algorithm is used to encrypt it. To see the source Ah, ready to download the source to see how to encrypt, modify the source code to fix. Fortunately, the communication with colleagues, is not using what tools to encrypt. The discovery is indeed, is through the Base64 tool encryption. Then use Linux with the tool base64 decryption can be.

echo "$encrypted _body" | Base64-d

The decryption result can be obtained as above command.

The key point is already good, use the script to string up these points, fix.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.