예제 #1
0
        /// <summary>
        /// Posts the specified string to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postString">The string to post.</param>
        /// <param name="contentType">The type of the content being posted.</param>
        /// <param name="verb">The HTTP verb for the request.</param>
        /// <param name="headers">The headers for the request.</param>
        public NetworkResponse PostString(string uri, string postString, string contentType, string verb, IDictionary <string, string> headers)
        {
            // convert object to bytes via an XML
            byte[] postBytes = NetworkUtils.StrToByteArray(postString);

            return(PostBytes(uri, postBytes, contentType, verb, headers));
        }
예제 #2
0
        /// <summary>
        /// Posts the specified string to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postString">The string to post.</param>
        /// <param name="headers">The headers for the request.</param>
        public NetworkResponse PostString(string uri, string postString, IDictionary <string, string> headers)
        {
            // convert object to bytes via an XML
            byte[] postBytes = NetworkUtils.StrToByteArray(postString);

            return(PostBytes(uri, postBytes, "application/x-www-form-urlencoded", "POST", headers));
        }
예제 #3
0
        /// <summary>
        /// Posts the specified string to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postString">The string to post.</param>
        /// <param name="contentType">The type of the content being posted.</param>
        /// <param name="verb">The HTTP verb for the request.</param>
        /// <param name="headers">The headers for the request.</param>
        public NetworkResponse PostString(string uri, string postString, string contentType, string verb, IDictionary <string, string> headers)
        {
            byte[] postBytes = NetworkUtils.StrToByteArray(postString);

            // default headers to null rather than Device.RequestInjectionHeaders as we cannot guarantee the
            // default headers are relevant to the specified URI
            return(PostBytes(uri, postBytes, contentType, verb, headers, null));
        }
예제 #4
0
        /// <summary>
        /// Posts the specified string to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postString">The string to post.</param>
        /// <param name="contentType">The type of the content being posted.</param>
        public NetworkResponse PostString(string uri, string postString, string contentType)
        {
            // convert object to bytes via an XML
            byte[] postBytes = NetworkUtils.StrToByteArray(postString);

            // default headers to null rather than Device.RequestInjectionHeaders as we cannot guarantee the
            // default headers are relevant to the specified URI
            return(PostBytes(uri, postBytes, contentType, "POST", null));
        }
예제 #5
0
        public NetworkResponse PostString(string uri, string postString)
        {
            // convert object to bytes via an XML
            byte[] postBytes = NetworkUtils.StrToByteArray(postString);

            // default headers to null rather than iApp.RequestInjectionHeaders as we cannot guarantee the
            // default headers are relevant to the specified URI
            return(PostBytes(uri, postBytes, "application/x-www-form-urlencoded", "POST", null));
        }