*webapi.txt*		interface to Web APIs written in pure vimscript.

Maintainer: mattn <mattn.jp@gmail.com>

==============================================================================
CONTENTS				*webapi-contents*

INTRODUCTION				|webapi-introduction|
FUNCTIONS				|webapi-functions|

==============================================================================
INTRODUCTION				*webapi-introduction*

|webapi| include:

  * XML parser Library.
  * HTML parser Library.
  * JSON parser Library.
  * HTTP client.

  and some utility functions.

==============================================================================
INTERFACE				*webapi-functions*

webapi#xml#parse(content)				*webapi#xml#parse()*
	Parse content into DOM object.

webapi#xml#parseFile(file)				*webapi#xml#parseFile()*
	Parse xml file into DOM object.

webapi#xml#parseURI(url)				*webapi#xml#parseURI()*
	Get and parse html into DOM object.

  DOM object is structured as |Directory| like following.
>
	{
	  "name": "a",
	  "attr": {
	    "href": "http://example.com",
	    "title": "example",
	  },
	  "child": [...]
	}
<
webapi#http#get(url, param, header)			*webapi#http#get()*
	Send GET request to url.

webapi#http#post(url, param, header)			*webapi#http#post()*
	Send POST request to url.

webapi#http#encodeURI(param)				*webapi#http#encodeURI()*
	Encode params as URI query.

webapi#http#decodeURI(str)				*webapi#http#decodeURI()*
	Decode string as URI params.

webapi#http#encodeURIComponent(str)		*webapi#http#encodeURIComponent()*
	Encode param as URI components.

  |webapi#http#get| and |webapi#http#post| return data structure as
  |Dictionary| like following.
>
	{
	  "header": [
	    "Content-Type: text/html",
	    "Content-Length: 310"
	  ],
	  "content": "<html> ....."
	}
<
webapi#json#encode(object)				*webapi#json#encode()*
	Encode object into JSON string.

webapi#json#decode(json)				*webapi#json#decode()*
	Decode JSON string into variable that vim can treat.

==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl
