Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
JavaClientSample.java
README.txt
curl_client_sample.sh
go_client_sample.go
json-simple-1.1.1.jar
make_go.sh
make_java.sh
make_python.sh
perl_client_sample.pl
php_client_sample.php
pindent.py
python_client_sample.py
ruby_client_sample.rb
wget_client_sample.sh

README.txt

Petstore Enhanced Sample Client Programs

After the server is listening, you can send it REST API requests using the included client programs.

Steps:

1. source ../set.sh
2. ./curl_client_sample.sh
3. ./go_client_sample.go
4. ./make_java.sh
5. ./perl_client_sample.pl
6. ./php_client_sample.php
7. ./python_client_sample.py
8. ./ruby_client_sample.rb
9. ./wget_client_sample.sh (curl is more REST API-friendly, so use curl if possible)

These are short but non-trivial programs with features such as:

- GET, PUT, DELETE methods
- HTTP Basic Authentication
- JSON PUT
- connection timeout
- error handling based on HTTP response codes
- separate user and admin credentials.

Take a look at the source code to see how to write your own programs.

For C/C++ programs, see the libcurl samples at https://curl.haxx.se/libcurl/c/example.html