summaryrefslogtreecommitdiffstats
path: root/source/Janrain.OpenId/Server/WebResponse.cs
blob: b82a5ffc3aeb3c8dfd55be56977d6e226d9f6a5a (plain)
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
using System;
using System.Collections.Specialized;
using System.Text;

namespace Janrain.OpenId.Server
{

    public enum HttpCode : int
    {
        HTTP_OK = 200,
        HTTP_REDIRECT = 302,
        HTTP_ERROR = 400
    }

    public class WebResponse
    {

        #region Private Members

        private HttpCode _code;
        private NameValueCollection _headers;
        private byte[] _body;

        #endregion

        #region Constructor(s)

        public WebResponse(HttpCode code, NameValueCollection headers, byte[] body)
        {
            _code = code;

            if (headers == null)
                _headers = new NameValueCollection();
            else
                _headers = headers;

            _body = body;
        }

        #endregion

        #region Properties

        public HttpCode Code
        {
            get { return _code; }
        }

        public NameValueCollection Headers
        {
            get { return _headers; }
        }

        public byte[] Body
        {
            get { return _body; }
        }

        #endregion

    }
}