浏览代码

Patch provided by Eric Merritt to support WebDAV requests

pull/16/head
chandrusf 18 年前
父节点
当前提交
6675c44672
共有 5 个文件被更改,包括 31 次插入15 次删除
  1. +5
    -2
      README
  2. +2
    -2
      src/ibrowse.erl
  3. +15
    -8
      src/ibrowse_http_client.erl
  4. +8
    -2
      src/ibrowse_lib.erl
  5. +1
    -1
      vsn.mk

+ 5
- 2
README 查看文件

@ -1,8 +1,9 @@
$Id: README,v 1.7 2007/01/26 10:02:59 chandrusf Exp $
$Id: README,v 1.8 2007/03/21 00:26:40 chandrusf Exp $
ibrowse is a HTTP client. The following are a list of features.
- RFC2616 compliant (AFAIK)
- supports GET, POST, OPTIONS, HEAD, PUT, DELETE, TRACE only
- supports GET, POST, OPTIONS, HEAD, PUT, DELETE, TRACE,
MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, MOVE and COPY
- Understands HTTP/0.9, HTTP/1.0 and HTTP/1.1
- Understands chunked encoding
- Can generate requests using Chunked Transfer-Encoding
@ -21,6 +22,8 @@ Comments to : Chandrashekhar.Mullaparthi@t-mobile.co.uk
CONTRIBUTIONS & CHANGE HISTORY
==============================
06-03-2007 - Eric Merritt sent a patch to support WebDAV requests.
12-01-2007 - Derek Upham sent in a bug fix. The reset_state function was not
behaving correctly when the transfer encoding was not chunked.

+ 2
- 2
src/ibrowse.erl 查看文件

@ -58,7 +58,7 @@
%% driver isn't actually used.</p>
-module(ibrowse).
-vsn('$Id: ibrowse.erl,v 1.2 2005/12/08 12:05:07 chandrusf Exp $ ').
-vsn('$Id: ibrowse.erl,v 1.3 2007/03/21 00:26:41 chandrusf Exp $ ').
-behaviour(gen_server).
%%--------------------------------------------------------------------
@ -157,7 +157,7 @@ set_dest(Host,Port,Opts) ->
%% headerList() = [{header(), value()}]
%% header() = atom() | string()
%% value() = term()
%% method() = get | post | head | options | put | delete | trace
%% method() = get | post | head | options | put | delete | trace | mkcol | propfind | proppatch | lock | unlock | move | copy
%% Status = string()
%% ResponseHeaders = [respHeader()]
%% respHeader() = {headerName(), headerValue()}

+ 15
- 8
src/ibrowse_http_client.erl 查看文件

@ -6,7 +6,7 @@
%%% Created : 11 Oct 2003 by Chandrashekhar Mullaparthi <chandrashekhar.mullaparthi@t-mobile.co.uk>
%%%-------------------------------------------------------------------
-module(ibrowse_http_client).
-vsn('$Id: ibrowse_http_client.erl,v 1.9 2007/01/26 10:02:59 chandrusf Exp $ ').
-vsn('$Id: ibrowse_http_client.erl,v 1.10 2007/03/21 00:26:41 chandrusf Exp $ ').
-behaviour(gen_server).
%%--------------------------------------------------------------------
@ -993,13 +993,20 @@ fmt_val(Term) -> io_lib:format("~p", [Term]).
crnl() -> "\r\n".
method(get) -> "GET";
method(post) -> "POST";
method(head) -> "HEAD";
method(options) -> "OPTIONS";
method(put) -> "PUT";
method(delete) -> "DELETE";
method(trace) -> "TRACE".
method(get) -> "GET";
method(post) -> "POST";
method(head) -> "HEAD";
method(options) -> "OPTIONS";
method(put) -> "PUT";
method(delete) -> "DELETE";
method(trace) -> "TRACE";
method(mkcol) -> "MKCOL";
method(propfind) -> "PROPFIND";
method(proppatch) -> "PROPPATCH";
method(lock) -> "LOCK";
method(unlock) -> "UNLOCK";
method(move) -> "MOVE";
method(copy) -> "COPY".
%% From RFC 2616
%%

+ 8
- 2
src/ibrowse_lib.erl 查看文件

@ -5,7 +5,7 @@
%% @doc Module with a few useful functions
-module(ibrowse_lib).
-vsn('$Id: ibrowse_lib.erl,v 1.3 2005/12/08 12:05:07 chandrusf Exp $ ').
-vsn('$Id: ibrowse_lib.erl,v 1.4 2007/03/21 00:26:41 chandrusf Exp $ ').
-author('chandru').
-ifdef(debug).
-compile(export_all).
@ -98,6 +98,7 @@ month_int("Dec") -> 12.
%% StatusDescription = atom()
status_code(100) -> continue;
status_code(101) -> switching_protocols;
status_code(102) -> processing;
status_code(200) -> ok;
status_code(201) -> created;
status_code(202) -> accepted;
@ -105,6 +106,7 @@ status_code(203) -> non_authoritative_information;
status_code(204) -> no_content;
status_code(205) -> reset_content;
status_code(206) -> partial_content;
status_code(207) -> multi_status;
status_code(300) -> multiple_choices;
status_code(301) -> moved_permanently;
status_code(302) -> found;
@ -131,12 +133,16 @@ status_code(414) -> request_uri_too_long;
status_code(415) -> unsupported_media_type;
status_code(416) -> requested_range_not_satisfiable;
status_code(417) -> expectation_failed;
status_code(422) -> unprocessable_entity;
status_code(423) -> locked;
status_code(424) -> failed_dependency;
status_code(500) -> internal_server_error;
status_code(501) -> not_implemented;
status_code(502) -> bad_gateway;
status_code(503) -> service_unavailable;
status_code(504) -> gateway_timeout;
status_code(505) -> http_version_not_supported;
status_code(507) -> insufficient_storage;
status_code(X) when is_list(X) -> status_code(list_to_integer(X));
status_code(_) -> unknown_status_code.
@ -146,6 +152,6 @@ status_code(_) -> unknown_status_code.
%% N = integer() - the number to represent as hex
dec2hex(M,N) -> dec2hex(M,N,[]).
dec2hex(0,N,Ack) -> Ack;
dec2hex(0,_N,Ack) -> Ack;
dec2hex(M,N,Ack) -> dec2hex(M-1,N bsr 4,[d2h(N band 15)|Ack]).

+ 1
- 1
vsn.mk 查看文件

@ -1,2 +1,2 @@
IBROWSE_VSN = 1.2.4
IBROWSE_VSN = 1.2.5

正在加载...
取消
保存