Browse Source

Update README and add gif

Chang-Hung Liang 4 years ago
parent
commit
c5fd059cbe
2 changed files with 78 additions and 42 deletions
  1. 78 42
      README.rst
  2. BIN
      http-prompt.gif

+ 78 - 42
README.rst

@@ -1,54 +1,90 @@
-HTTP Prompt (A WORK IN PROGRESS)
-==============================
+HTTP Prompt
+===========
 
-|Build Status| |Coverage|
+|PyPI| |Build Status| |Coverage|
 
-An interactive command-line HTTP client featuring auto-completion and syntax
-highlighting.
+HTTP Prompt is an interactive command-line HTTP client featuring autocomplete
+and syntax highlighting, built on HTTPie_ and prompt_toolkit_.
 
-Use case::
+.. image:: http-prompt.gif
+
+
+Installation
+------------
+
+Just install it like a regular Python package::
+
+    $ pip install http-prompt
+
+You'll probably see some permission errors if you're installing it on the
+system-wide Python. If that's what you want to do, you need to ``sudo``::
+
+    $ sudo pip install http-prompt
+
+To upgrade HTTP Prompt, do::
+
+    $ pip install -U http-prompt
+
+
+Qucikstart
+----------
+
+Starting a session::
 
     $ http-prompt http://httpbin.org
-    Welcome to HTTP Prompt!
-    http://httpbin.org> cd post
-    http://httpbin.org/post> name=bob email=bob@example.com
-    http://httpbin.org/post> sex==M --form
-    http://httpbin.org/post> post
-    HTTP/1.1 200 OK
-    Access-Control-Allow-Credentials: true
-    Access-Control-Allow-Origin: *
-    Connection: keep-alive
-    Content-Length: 473
-    Content-Type: application/json
-    Date: Wed, 27 Apr 2016 09:04:29 GMT
-    Server: nginx
-
-    {
-        "args": {
-            "sex": "M"
-        },
-        "data": "",
-        "files": {},
-        "form": {
-            "email": "bob@example.com",
-            "name": "bob"
-        },
-        "headers": {
-            "Accept": "*/*",
-            "Accept-Encoding": "gzip, deflate",
-            "Content-Length": "32",
-            "Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
-            "Host": "httpbin.org",
-            "User-Agent": "HTTPie/0.9.3"
-        },
-        "json": null,
-        "origin": "x.x.x.x",
-        "url": "http://httpbin.org/post?sex=M"
-    }
 
+To change URL address, use ``cd``::
+
+    > cd api/v1
+    > cd http://localhost/api
+
+To add headers, querystring, or body parameters, use the syntax as in HTTPie_::
+
+    > Content-Type:application/json username=john
+    > 'name=John Doe' apikey=abc
+
+You can also add HTTPie_ options like this::
+
+    > --form --auth user:pass
+
+To preview how HTTP Prompt is going to call HTTPie_, do::
+
+    > httpie post
+    http --auth user:pass --form POST http://localhost/api apikey==abc username=john
+
+To actually send a request, enter one of the HTTP methods::
+
+    > get
+    > post
+    > put
+    > patch
+    > delete
+
+To remove an existing header, querystring, body parameter, or HTTPie_ option::
+
+    > rm -h Content-Type
+    > rm -q apikey
+    > rm -b username
+    > rm -o --auth
+
+
+Roadmap
+-------
+
+* Allow users to customize via a configuration file
+* Include more headers for autocomplete
+* Write more tests
+* Write more documentation
+
+
+.. |PyPI| image:: https://img.shields.io/pypi/v/http-prompt.svg
+    :target: https://pypi.python.org/pypi/http-prompt
 
 .. |Build Status| image:: https://api.travis-ci.org/eliangcs/http-prompt.svg?branch=master
     :target: https://travis-ci.org/eliangcs/http-prompt
 
 .. |Coverage| image:: https://coveralls.io/repos/github/eliangcs/http-prompt/badge.svg?branch=master
     :target: https://coveralls.io/github/eliangcs/http-prompt?branch=master
+
+.. _HTTPie: https://github.com/jkbrzt/httpie
+.. _prompt_toolkit: https://github.com/jonathanslenders/python-prompt-toolkit

BIN
http-prompt.gif