Encog.Cloud.CloudRequest.PerformURLPOST C# (CSharp) Method

PerformURLPOST() public method

Perform a POST to the cloud.
public PerformURLPOST ( bool async, String service, String>.IDictionary args ) : void
async bool True if this request should be asynchronous.
service String The service.
args String>.IDictionary The POST arguments.
return void
        public void PerformURLPOST(bool async, String service,
                IDictionary<String, String> args)
        {
            try
            {
                if (async)
                {
                    AsynchronousCloudRequest request = new AsynchronousCloudRequest(
                            service, args);
                    Thread t = new Thread(new ThreadStart(request.Run));
                    t.Start();
                }
                else
                {
                    String contents = BotUtil.POSTPage(new Uri(service), args);
                    HandleResponse(contents);
                }
            }
            catch (IOException e)
            {
                throw new EncogCloudError(e);
            }
        }

Same methods

CloudRequest::PerformURLPOST ( string service, Stream stream ) : void

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Publish the specified file.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="publishedPath">Where to publish the file.</param>
        public void PublishFile(Stream stream, String publishedPath)
        {
            String       uri     = this.session + "publish" + publishedPath;
            CloudRequest request = new CloudRequest();

            request.PerformURLPOST(uri, stream);
        }
All Usage Examples Of Encog.Cloud.CloudRequest::PerformURLPOST