コード例 #1
0
ファイル: RemoteLRS.cs プロジェクト: rmabraham/TinCan.NET
        private LRSResponse SaveDocument(String resource, Dictionary<String, String> queryParams, Document document)
        {
            var r = new LRSResponse();

            var req = new MyHTTPRequest();
            req.method = "PUT";
            req.resource = resource;
            req.queryParams = queryParams;
            req.contentType = document.contentType;
            req.content = document.content;

            var res = MakeSyncRequest(req);
            if (res.status != HttpStatusCode.NoContent)
            {
                r.success = false;
                r.httpException = res.ex;
                r.SetErrMsgFromBytes(res.content);
                return r;
            }

            r.success = true;

            return r;
        }
コード例 #2
0
ファイル: RemoteLRS.cs プロジェクト: rmabraham/TinCan.NET
        private MyHTTPResponse GetDocument(String resource, Dictionary<String, String> queryParams, Document document)
        {
            var req = new MyHTTPRequest();
            req.method = "GET";
            req.resource = resource;
            req.queryParams = queryParams;

            var res = MakeSyncRequest(req);
            if (res.status == HttpStatusCode.OK)
            {
                document.content = res.content;
                document.contentType = res.contentType;
                document.timestamp = res.lastModified;
                document.etag = res.etag;
            }

            return res;
        }