DeltaDNA.HttpRequest.getHeaders C# (CSharp) Method

getHeaders() private method

private getHeaders ( ) : string>.Dictionary
return string>.Dictionary
        internal Dictionary<string, string> getHeaders()
        {
            return this.headers;
        }

Usage Example

Exemplo n.º 1
0
        internal static IEnumerator SendRequest(HttpRequest request, Action <int /*statusCode*/, string /*data*/, string /*error*/> completionHandler)
        {
            WWW www;

            if (request.HTTPMethod == HttpRequest.HTTPMethodType.POST)
            {
                Dictionary <string, string> headers = new Dictionary <string, string>();

                WWWForm form = new WWWForm();
                foreach (var entry in Utils.HashtableToDictionary <string, string>(form.headers))
                {
                    headers[entry.Key] = entry.Value;
                }

                foreach (var entry in request.getHeaders())
                {
                    headers[entry.Key] = entry.Value;
                }

                byte[] bytes = Encoding.UTF8.GetBytes(request.HTTPBody);

                www = new WWW(request.URL, bytes, headers);
            }
            else
            {
                www = new WWW(request.URL);
            }

            yield return(www);

            int    statusCode = ReadStatusCode(www);
            string data       = www.text;
            string error      = www.error;

            if (completionHandler != null)
            {
                completionHandler(statusCode, data, error);
            }
        }
All Usage Examples Of DeltaDNA.HttpRequest::getHeaders