Пример #1
0
        /// <summary>
        /// Get all response header fields.
        /// </summary>
        public CefStringMultiMap GetHeaderMap()
        {
            var result = new CefStringMultiMap();

            cef_response_t.invoke_get_header_map(this.ptr, result.Handle);
            return(result);
        }
Пример #2
0
        /// <summary>
        /// Set all values at one time.
        /// </summary>
        public void Set(string url, string method, CefPostData postData, CefStringMultiMap headerMap)
        {
            // TODO: check args

            fixed (char* url_str = url)
            fixed (char* method_str = method)
            {
                var n_url = new cef_string_t(url_str, url != null ? url.Length : 0);
                var n_method = new cef_string_t(method_str, method != null ? method.Length : 0);

                cef_request_t.invoke_set(this.ptr, &n_url, &n_method, postData.GetNativePointerAndAddRef(), headerMap.Handle);
            }
        }
Пример #3
0
        /// <summary>
        /// Set all values at one time.
        /// </summary>
        public void Set(string url, string method, CefPostData postData, CefStringMultiMap headerMap)
        {
            // TODO: check args

            fixed(char *url_str = url)
            fixed(char *method_str = method)
            {
                var n_url    = new cef_string_t(url_str, url != null ? url.Length : 0);
                var n_method = new cef_string_t(method_str, method != null ? method.Length : 0);

                cef_request_t.invoke_set(this.ptr, &n_url, &n_method, postData.GetNativePointerAndAddRef(), headerMap.Handle);
            }
        }
Пример #4
0
        protected override void GetResponseHeaders(CefResponse response, out long responseLength, ref string redirectUrl)
        {
            responseLength = this.responseLength;

            if (responseLength != -1)
            {
                var headers = new CefStringMultiMap();
                headers.Append("Content-Length", responseLength.ToString());
                response.SetHeaderMap(headers);
            }

            response.SetStatus(this.status);
            response.SetStatusText(this.statusText);
            response.SetMimeType(this.mimeType);
        }
        public void Test1()
        {
            var map = new CefStringMultiMap();

            map.Append("Key 1", "String 1");
            map.Append("Key 2", "String 2");
            map.Append("Key 2", "String 2.1");
            map.Append("Key 3", "String 3");

            Assert.That(map.Count, Is.EqualTo(4));

            // TODO:

            map.Clear();
            Assert.That(map.Count, Is.EqualTo(0));

            // TODO: map.Dispose();
        }
Пример #6
0
 /// <summary>
 /// Get the header values.
 /// </summary>
 public CefStringMultiMap GetHeaderMap()
 {
     var result = new CefStringMultiMap();
     cef_request_t.invoke_get_header_map(this.ptr, result.Handle);
     return result;
 }
Пример #7
0
 /// <summary>
 /// Set the header values.
 /// </summary>
 public void SetHeaderMap(CefStringMultiMap headerMap)
 {
     // TOOD: check args
     cef_request_t.invoke_set_header_map(this.ptr, headerMap.Handle);
 }
Пример #8
0
        /// <summary>
        /// Set all response header fields.
        /// </summary>
        public void SetHeaderMap(CefStringMultiMap headerMap)
        {
            // TODO: check args

            cef_response_t.invoke_set_header_map(this.ptr, headerMap.Handle);
        }