Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
        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));
        }