Beispiel #1
0
        /// <summary>
        /// Posts the specified object to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postObject">The object to post.</param>
        /// <param name="verb">The HTTP verb for the request.</param>
        /// <param name="headers">The headers for the request.</param>
        /// <param name="timeout">The timeout value in milliseconds.</param>
        public NetworkResponse PostObject(string uri, object postObject, string verb, IDictionary <string, string> headers, int timeout)
        {
            // convert object to bytes via an XML
            byte[] postBytes = NetworkUtils.XmlSerializeObjectToBytes(postObject);

            return(PostBytes(uri, postBytes, "application/xml", verb, headers, postObject, timeout));
        }
Beispiel #2
0
        /// <summary>
        /// Posts the specified object to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postObject">The object to post.</param>
        /// <param name="verb">The HTTP verb for the request.</param>
        /// <param name="headers">The headers for the request.</param>
        /// <param name="timeout">The timeout value in milliseconds.</param>
        public NetworkResponse PostObject(string uri, object postObject, string verb, IDictionary <string, string> headers, int timeout)
        {
            // convert object to bytes via an XML serializer, JSON not supported in MonoCross
            byte[] postBytes = NetworkUtils.XmlSerializeObjectToBytes(postObject);

            // 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, "application/xml", verb, headers, postObject, timeout));
        }
Beispiel #3
0
        /// <summary>
        /// Posts the specified object to the specified URI.
        /// </summary>
        /// <param name="uri">The URI to post to.</param>
        /// <param name="postObject">The object to post.</param>
        /// <param name="verb">The HTTP verb for the request.</param>
        public NetworkResponse PostObject(string uri, object postObject, string verb)
        {
            // convert object to bytes via an XML
            byte[] postBytes = NetworkUtils.XmlSerializeObjectToBytes(postObject);

            // 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, "application/xml", verb, null, postObject));
        }
Beispiel #4
0
        public NetworkResponse PostObject(string uri, object postObject, Dictionary <string, string> headers)
        {
            // convert object to bytes via an XML serializer, JSON not supported in iFactr.Core
            byte[] postBytes = NetworkUtils.XmlSerializeObjectToBytes(postObject);

            // 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/xml", "POST", headers));
        }