aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client/http.erl
blob: 7e1e90b50e433ebb8f521b96766d417214a1ca23 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%%
%% %CopyrightEnd%
%%
%%

%% Description:
%%% This version of the HTTP/1.1 client supports:
%%%      - RFC 2616 HTTP 1.1 client part
%%%      - RFC 2818 HTTP Over TLS

-module(http).

%% API
-export([request/1, request/2, request/4, request/5,
	 cancel_request/1, cancel_request/2,
	 set_option/2, set_option/3,
	 set_options/1, set_options/2,
	 verify_cookies/2, verify_cookies/3, cookie_header/1, 
	 cookie_header/2, stream_next/1,
	 default_profile/0]).


%%%=========================================================================
%%%  API
%%%=========================================================================

%%--------------------------------------------------------------------------
%% request(Url [, Profile]) ->
%% request(Method, Request, HTTPOptions, Options [, Profile])
%%--------------------------------------------------------------------------

request(Url)          -> httpc:request(Url).
request(Url, Profile) -> httpc:request(Url, Profile).

request(Method, Request, HttpOptions, Options) ->
    httpc:request(Method, Request, HttpOptions, Options). 
request(Method, Request, HttpOptions, Options, Profile) ->
    httpc:request(Method, Request, HttpOptions, Options, Profile). 


%%--------------------------------------------------------------------------
%% cancel_request(RequestId [, Profile])
%%-------------------------------------------------------------------------

cancel_request(RequestId) ->
    httpc:cancel_request(RequestId).
cancel_request(RequestId, Profile) ->
    httpc:cancel_request(RequestId, Profile).


%%--------------------------------------------------------------------------
%% set_options(Options [, Profile])
%% set_option(Key, Value [, Profile])
%%-------------------------------------------------------------------------

set_options(Options) ->
    httpc:set_options(Options).
set_options(Options, Profile) ->
    httpc:set_options(Options, Profile).

set_option(Key, Value) ->
    httpc:set_option(Key, Value).
set_option(Key, Value, Profile) ->
    httpc:set_option(Key, Value, Profile).


%%--------------------------------------------------------------------------
%% verify_cookies(SetCookieHeaders, Url [, Profile])
%%-------------------------------------------------------------------------

verify_cookies(SetCookieHeaders, Url) ->
    httpc:store_cookies(SetCookieHeaders, Url).
verify_cookies(SetCookieHeaders, Url, Profile) ->
    httpc:store_cookies(SetCookieHeaders, Url, Profile).


%%--------------------------------------------------------------------------
%% cookie_header(Url [, Profile])
%%-------------------------------------------------------------------------

cookie_header(Url) ->
    httpc:cookie_header(Url).
cookie_header(Url, Profile) ->
    httpc:cookie_header(Url, Profile).


%%--------------------------------------------------------------------------
%% stream_next(Pid)
%%-------------------------------------------------------------------------

stream_next(Pid) ->
    httpc:stream_next(Pid).


%%--------------------------------------------------------------------------
%% default_profile()
%%-------------------------------------------------------------------------

default_profile() ->
    httpc:default_profile().