Permalink
Browse files

removed redundant docs

  • Loading branch information...
1 parent 26b3f31 commit 7ff673fab7e1d1683f4fd088aa57aeeec050cbfd @micha committed Mar 11, 2011
Showing with 0 additions and 1,001 deletions.
  1. +0 −9 doc/index.txt
  2. +0 −355 doc/resty.1
  3. +0 −369 doc/resty.1.html
  4. +0 −268 doc/resty.1.md
View
@@ -1,9 +0,0 @@
-cat(1) http://man.cx/cat(1)
-lynx(1) http://man.cx/lynx(1)
-html2text(1) http://man.cx/html2text(1)
-bash(1) http://man.cx/bash(1)
-sed(1) http://man.cx/sed(1)
-awk(1) http://man.cx/awk(1)
-zsh(1) http://man.cx/zsh(1)
-grep(1) http://man.cx/grep(1)
-vim(1) http://man.cx/vim(1)
View
@@ -1,355 +0,0 @@
-.\" generated with Ronn/v0.7.3
-.\" http://github.com/rtomayko/ronn/tree/0.7.3
-.
-.TH "RESTY" "1" "January 2011" "" ""
-.
-.SH "NAME"
-\fBresty\fR \- command line REST client
-.
-.SH "SYNOPSIS"
-\fBsource\fR \fBresty\fR [\fB\-W\fR] [\fIremote\fR]
-.
-.br
-\fBresty\fR [\fIremote\fR]
-.
-.br
-\fBHEAD\fR [\fIpath\fR] [\fIcurl options\fR]
-.
-.br
-\fBOPTIONS\fR [\fIpath\fR] [\fIcurl options\fR]
-.
-.br
-\fBGET\fR [\fIpath\fR] [\fB\-Z\fR] [\fIcurl options\fR]
-.
-.br
-\fBDELETE\fR [\fIpath\fR] [\fB\-Z\fR] [\fIcurl options\fR]
-.
-.br
-\fBPUT\fR [\fIpath\fR] [\fIdata\fR\fB|\-V\fR] [\fB\-Z\fR] [\fIcurl options\fR]
-.
-.br
-\fBPOST\fR [\fIpath\fR] [\fIdata\fR\fB|\-V\fR] [\fB\-Z\fR] [\fIcurl options\fR]
-.
-.br
-\fBTRACE\fR [\fIpath\fR] [\fIdata\fR\fB|\-V\fR] [\fB\-Z\fR] [\fIcurl options\fR]
-.
-.br
-.
-.SH "DESCRIPTION"
-\fBResty\fR is a command line REST client for the bash(1) or zsh(1) shell\. It is implemented as functions in the shell, and can be used in pipelines with sed(1), awk(1), grep(1), etc\.
-.
-.P
-The \fBresty\fR script contains the definitions for the \fBresty\fR function and functions for each of the REST verbs: HEAD, OPTIONS, GET, DELETE, PUT, POST, and TRACE\. This script must be sourced from the shell before the functions can be used\.
-.
-.P
-The \fBresty\fR function is used to get or set the URI base, as described below under \fIREQUEST URI BASE\fR\. When no \fIremote\fR argument is specified, the URI base is printed to stdout\. Otherwise, a new request URI base is set to \fIremote\fR, and the resulting URI base is printed to stdout\.
-.
-.P
-The REST verb functions are used to make HTTP requests\. For PUT and POST requests data can be provided on the command line, stdin, or from a text editor\. Response data is printed to stdout\.
-.
-.SH "OPTIONS"
-This option is used when sourcing the \fBresty\fR script, not with the \fBresty\fR or HTTP verb functions\.
-.
-.TP
-\fB\-W\fR
-Don\'t write history file\. This is handy when using \fBresty\fR in scripts, where the URI history file is not relevant\.
-.
-.P
-These options are used with the \fBresty\fR and HTTP verb functions\. They control how data is provided to HTTP requests, and how responses are formatted in the terminal\.
-.
-.TP
-\fB\-V\fR
-Edit PUT/POST data interactively in a text editor\. The editor used will be the one in the EDITOR environment variable, or vim(1) otherwise\.
-.
-.TP
-\fB\-Z\fR
-Don\'t process HTML response with lynx(1) or html2text(1), just send the raw response to stdout\.
-.
-.SH "CURL OPTIONS"
-Options other than those listed above under \fIOPTIONS\fR are passed directly to \fBcurl\fR\.
-.
-.SH "REQUEST URI BASE"
-The request URI base is a template for the URIs to which requests will be made\. It is a URI that may contain the \fB*\fR character (possibly more than once)\. Each instance of \fB*\fR is replaced with the \fIpath\fR parameter in the HTTP request\.
-.
-.P
-If the protocol part of the URI is omitted when setting the URI base, the default \fBhttp\fR is used\. Also, if no \fB*\fR is present one is appended to the end of the URI by default\.
-.
-.SS "URI Base History"
-The URI base is saved to a text file (\fI~/\.resty/host\fR) each time it is set, and the last setting is saved in an environment variable (\fB$_resty_host\fR)\. The \fBresty\fR function checks to determine whether the environment variable is set\. If it is not, it reads the text file and sets the URI base accordingly\. In this way each shell maintains its own URI base\.
-.
-.SH "PATH PARAMETER"
-The HTTP verb functions\' first (optional) parameter is the \fIpath\fR\. The \fIpath\fR must always start with a \fB/\fR character\. The \fIpath\fR is substituted for each instance of \fB*\fR in the URI base when a request is made\.
-.
-.SS "Path History"
-If no \fIpath\fR is specified, then the last \fIpath\fR specified will be used\. This "last path" is stored in the \fB$_resty_path\fR environment variable\.
-.
-.SS "Path URL Encoding & Query Strings"
-\fBResty\fR encodes the path, except for the \fB/\fR character (\fB/\fR must be manually encoded, eg\. \fB%2F\fR)\. Since this means that \fB?\fR, \fB=\fR, and \fB&\fR characters will be URL encoded, as well as some other problematic characters, curl options must be used to send query parameters in requests\. The \fB\-d\fR and \fB\-G\fR curl options provide this functionality\.
-.
-.SH "RESPONSE BODY"
-The body of the HTTP response is printed to stdout for all successful (HTTP 2xx status) requests\. The body of all other responses is dumped to stderr\.
-.
-.P
-In either case, if the content\-type of the response is \fBtext/html\fR \fBresty\fR will attempt to filter the response body through one of lynx(1), html2text(1), or cat(1), in that order\. This behavior can be disabled with the \fB\-Z\fR option to get the raw response body\.
-.
-.SH "EXIT STATUS"
-Successful requests (HTTP 2xx response status) exit with a status of zero\. Otherwise, the first digit of the HTTP response status is returned\. The \fB\-v\fR curl option is available when the exact status is required\.
-.
-.SH "PER\-HOST, PER\-METHOD CONFIGURATION FILES"
-\fBResty\fR supports per\-host, per\-method configuration files to help with frequently used curl options\. Each host (optionally including the port) may have its own configuration file in the \fI~/\.resty\fR directory\. Each line of the file consists of an HTTP method followed by a number of curl options, exactly as they would appear on the command line\.
-.
-.P
-Then, when a request is made, \fBresty\fR checks to see if there is a config file named for that host/port\. If there is one, it then checks the file to find the line corresponding to the request method\. If such a line exists then the rest of the line is passed to curl as options\.
-.
-.TP
-\fBEx:\fR
-Sometimes the server setup requires curl options to be specified on every request\. This can get to be extremely cumbersome and tedious after a while\. Suppose your case requires many requests of this form:
-.
-.IP
-$ resty example\.com:8080
-.
-.br
-http://example\.com:8080*
-.
-.br
-$ GET / \-H \'Accept:application/json\' \-u mylogin:secretpasswd
-.
-.br
-\&\.\.\. response \.\.\.
-.
-.br
-$ DELETE /other/path/ \-H \'Accept:application/json\' \-u mylogin:secretpasswd
-.
-.br
-\&\.\.\. response \.\.\.
-.
-.br
-.
-.IP
-By making a per\-host configuration file in your \fI~/\.resty/\fR directory you can have these boilerplate options added automatically for each request\. Create the file \fI~/\.resty/example\.com:8080\fR with the following contents:
-.
-.IP
-GET \-H \'Accept:application/json\' \-u mylogin:secretpasswd
-.
-.br
-DELETE \-H \'Accept:application/json\' \-u mylogin:secretpasswd
-.
-.br
-.
-.IP
-Now all GET and DELETE requests to this host and port will have those options automatically applied\.
-.
-.SH "EXAMPLES"
-Here are a few examples to get things started\. First, a simple, common case\. The first command loads the resty functions into the shell:
-.
-.IP "" 4
-.
-.nf
-
-$ \. resty
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Then the request URI base is set:
-.
-.IP "" 4
-.
-.nf
-
-$ resty example\.com
-http://example\.com*
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Next, a GET request is made on http://example\.com/, and the response body is printed (response body HTML processed by lynx):
-.
-.IP "" 4
-.
-.nf
-
-$ GET /
- Hello, World!
-
- This is a test!
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Here the same URI is fetched with another GET request, but this time the raw response body printed:
-.
-.IP "" 4
-.
-.nf
-
-$ GET / \-Z
-<html>
- <body>
- <h1>Hello, World!</h1>
- <p>This is a test\.</p>
- </body>
-</html>
-.
-.fi
-.
-.IP "" 0
-.
-.P
-You can also use "pipelines" to filter resources\. Here a notional RESTful database is queried, and a record updated:
-.
-.IP "" 4
-.
-.nf
-
-$ GET /data/1
-{ "id" : 1, "foo" : "bar" }
-$ GET /data/1 | sed \'s/bar/baz/\' | PUT
-{ "id" : 1, "foo" : "baz" }
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Notice how the PUT command did not require a \fIpath\fR parameter\. The \fIpath\fR simply defaults to the last used \fIpath\fR, which in this case is \'/data/1\'\.
-.
-.P
-Here a new record is added with a POST request:
-.
-.IP "" 4
-.
-.nf
-
-$ POST /data/ \'{ "foo" : "bar" }\'
-{ "id" : 13, "foo" : "bar" }
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Or POST using data piped to stdin:
-.
-.IP "" 4
-.
-.nf
-
-$ GET /data/13 | sed \'s/bar/baz/\' | POST /data/
-{ "id" : 42, "foo" : "baz" }
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Or the record could be crafted using a text editor:
-.
-.IP "" 4
-.
-.nf
-
-$ GET /data/13 | POST /data \-V
-\.\.\. edit /data/13 in vim \.\.\.
-{ "id" : 43, "foo" : "baf" }
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Query strings are escaped in the \fIpath\fR parameter, so curl options are used:
-.
-.IP "" 4
-.
-.nf
-
-$ GET /data/1 \-d arg1=foo \-d arg2=bar \-G
-.
-.fi
-.
-.IP "" 0
-.
-.P
-HTTP basic authentication (\fB\-u\fR curl option):
-.
-.IP "" 4
-.
-.nf
-
-$ POST /data/ \-u user:pass < datafile
-.
-.fi
-.
-.IP "" 0
-.
-.P
-See the headers on stderr with the request body on stdout (\fB\-v\fR curl option):
-.
-.IP "" 4
-.
-.nf
-
-$ GET / \-v
-* About to connect() to example\.com port 80 (#0)
-* Trying 192\.168\.5\.101\.\.\. connected
-* Connected to thinkminimo\.com (192\.168\.5\.101) port 80 (#0)
-> GET / HTTP/1\.1
-> User\-Agent: curl/7\.21\.0 (x86_64\-apple\-darwin10\.2\.0) libcurl/7\.21\.0 OpenSSL/0\.9\.8o zlib/1\.2\.5 libidn/1\.19
-> Host: example\.com:80
-> Accept:a #0 to host example\.com left intact
-* Closing connection #0
- Hello, World!
-
- This is a test\.
-.
-.fi
-.
-.IP "" 0
-.
-.SH "FILES"
-.
-.TP
-\fB~/\.resty/\fR
-Directory containing \fBresty\fR configuration files\.
-.
-.TP
-\fB~/\.resty/host\fR
-Request URI base history file\.
-.
-.TP
-\fB~/\.resty/c\fR
-Cookie storage directory\.
-.
-.TP
-\fB~/\.resty/<host>[:<port>]\fR
-Per\-host options configuration files\.
-.
-.SH "ENVIRONMENT"
-.
-.TP
-\fB_resty_host\fR
-Last setting for request URI base\.
-.
-.TP
-\fB_resty_path\fR
-Last request \fIpath\fR parameter\. Used when no \fIpath\fR parameter is specified\.
-.
-.TP
-\fBEDITOR\fR
-Used to determine which text editor to use for editing PUT/POST request body\.
-.
-.SH "BUGS"
-Please report bugs here: \fIhttp://github\.com/micha/resty/issues\fR\.
-.
-.SH "COPYRIGHT"
-Copyright (C) 2009 Micha Niskin \fIhttp://github\.com/micha\fR, no rights reserved\.
-.
-.SH "SEE ALSO"
-awk(1), bash(1), cat(1), grep(1), html2text(1), lynx(1), sed(1), vim(1), zsh(1)
Oops, something went wrong.

0 comments on commit 7ff673f

Please sign in to comment.