Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8109579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:28:09+00:00 2026-06-06T01:28:09+00:00

I am using RestSharp to consume a REST web service and will be making

  • 0

I am using RestSharp to consume a REST web service and will be making a large volume of calls in a short time period.

The documentation for the API strongly recommends the use of persistent HTTP connections to do this, however I am struggling to get this working with RestSharp.

I have tried adding the “Connection: Keep-alive” header to the request but when I do this the request fails with the following error – “Keep-Alive and Close may not be set using this property.”

Can I not use this header with RestSharp or is there something else I need to do to enable this?

Can anyone help? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:28:11+00:00Added an answer on June 6, 2026 at 1:28 am

    To get a good answer, you need to ask a good question. Where in the documentation does it say this? (Link/Reference?) How many requests is a “large volume”? Also, if you post your code for how you added Connection: Keep-Alive to your http headers, someone here may be able to comment on your technique and help you with the specific programming issue.

    Also, Connection: Keep-Alive may already be present on the outgoing HttpRequests! Check it out using Fiddler or WireShark. I’ve seen a few blog posts with wireshark captures of RestSharp requests that had the Connection: Keep-Alive header present without any extra config. For example, while testing other mvc3 functionality using RestSharp as a consumer, Jimmy Bogard captures his RestSharp requests with fiddler which already have the Connection: Keep-Alive header.

    Apparently it is also the default behavior for built in .Net classes like System.Net.Webclient to use Connection: Keep-Alive. Reference Does WebClient use KeepAlive?

    I think that making use of keep alive is going to be more about your code using RestSharp in an optimal manner than it is about configuring RestSharp itself. If you want to make sure your connection is reused you need to make sure your use of RestSharp allows for that by keeping one RestClient instance in scope and reusing it throughout multiple requests against the same host.

    Again using Fiddler or WireShark will help you capture some HttpRequests for analysis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using RestSharp to consume a REST style service. Pretty new to this
I'm making a GET request to Yammer.com's REST API using RestSharp (which is awesome),
I have a slight situation. I'm interacting with a web service using RestSharp, where
I'm trying to connect to the last.fm rest services using restsharp. I can deserialize
Using Android 2.1+. I have a service that gets killed from time to time
Using CI for the first time and i'm smashing my head with this seemingly
Using import datetime in python, is it possible to take a formatted time/date string
I'm using RestSharp in a Mono project to upload some files and I have
I have a service manager class used to abstract my calls from my MVC
I am using Visual Studio C# 2010 Express and is learning. RESTSharp is supposed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.