Ejemplo n.º 1
0
        protected async void ButtonSend_Click(object sender, EventArgs e)
        {

            RequestOptions requestOptions = null;
 
            //Request response in JSON format            
            requestOptions = new RequestOptions();
            requestOptions.Headers.Add("Accept", "application/json");

            //Send Request
            var response = await Global.HelloServiceClient.GetAsync(Uri + TextBoxName.Text, requestOptions);

            //Display result
            PanelResponse.Visible = true;
            LabelResponse.Text = response.Content.ReadAsStringAsync().Result;

        }
Ejemplo n.º 2
0
 public static void SetRequestOptions(HttpRequestMessage request, RequestOptions options)
 {
     request.Properties[REQUEST_OPTIONS_KEY] = options;
 }
Ejemplo n.º 3
0
 private async static Task<System.Net.Http.HttpResponseMessage> SendMessage(RestBusClient client, RequestOptions requestOptions)
 {
     //Send Request
     var uri = "api/values"; //Substitute "hello/random" for the ServiceStack self-hosted example and "api/hello/random" for the ServiceStack ASP.Net hosted example
     return await client.GetAsync(uri, requestOptions);
 }
Ejemplo n.º 4
0
 private static RabbitMQMessagingProperties GetMessagingProperties(RequestOptions options)
 {
     if (options == null) return _defaultMessagingProperties;
     return (options.Properties as RabbitMQMessagingProperties) ?? _defaultMessagingProperties;
 }
Ejemplo n.º 5
0
        private TimeSpan GetRequestTimeout(RequestOptions options)
        {
            TimeSpan timeoutVal = this.Timeout;

            if (options != null && options.Timeout.HasValue)
            {
                timeoutVal = options.Timeout.Value;
            }

            return timeoutVal.Duration();
        }