PageSourceSearch

https://restsharp.dev/support/

html restsharp.dev collected 2026-10-02 10:51:27 UTC 21,458 bytes, 101 lines download raw bytes

1<!doctype html>
2<html lang="en" dir="ltr" class="mdx-wrapper mdx-page plugin-pages plugin-id-default" data-has-hydrated="false">
3<head>
4<meta charset="UTF-8">
5<meta name="generator" content="Docusaurus v3.10.2">
6<title data-rh="true">Get help | RestSharp</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://restsharp.dev/support"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Get help | RestSharp"><meta data-rh="true" name="description" content="Got issues, questions, suggestions? Please read this page carefully to understand how you can get help working with RestSharp."><meta data-rh="true" property="og:description" content="Got issues, questions, suggestions? Please read this page carefully to understand how you can get help working with RestSharp."><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://restsharp.dev/support"><link data-rh="true" rel="alternate" href="https://restsharp.dev/support" hreflang="en"><link data-rh="true" rel="alternate" href="https://restsharp.dev/support" hreflang="x-default"><link rel="stylesheet" href="/assets/css/styles.f9238495.css">
7<script src="/assets/js/runtime~main.4781b592.js" defer="defer"></script>
vendor: 1 bytes, line 7
7
8<script src="/assets/js/main.a2390e1d.js" defer="defer"></script>
8
9</head>
10<body>
11<svg style="display: none;"><defs>
12<symbol id="theme-svg-external-link" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol>
13</defs></svg>
14<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||"light"),document.documentElement.setAttribute("data-theme-choice",t||"light")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script>
14<div id="__docusaurus"><link rel="preload" as="image" href="/img/restsharp.png"><div role="region" aria-label="Skip to main content"><a class="skipToContent_iwTj" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="theme-layout-navbar navbar navbar--fixed-top"><div class="navbar__inner"><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/restsharp.png" alt="RestSharp Logo" class="themedComponent_WFTU themedComponent--light_Fgt0"><img src="/img/restsharp.png" alt="RestSharp Logo" class="themedComponent_WFTU themedComponent--dark_KGEU"></div><b class="navbar__title text--truncate">RestSharp</b></a><a class="navbar__item navbar__link" href="/docs/changelog">Documentation</a><a class="navbar__item navbar__link" href="/migration">Migration from v106</a><a class="navbar__item navbar__link" href="/support">Support</a></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class="navbar__link" aria-haspopup="true" aria-expanded="false" role="button" href="/docs/changelog">v114</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/docs/next/changelog">Next</a></li><li><a class="dropdown__link" href="/docs/changelog">v114</a></li><li><a class="dropdown__link" href="/docs/v113/changelog">v113</a></li><li><a class="dropdown__link" href="/docs/v112/changelog">v112</a></li><li><a class="dropdown__link" href="/docs/v111/intro">v111</a></li><li><a class="dropdown__link" href="/docs/v110/changelog">v110</a></li></ul></div><a href="https://github.com/RestSharp/RestSharp" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_l17c"><use href="#theme-svg-external-link"></use></svg></a><div class="toggle_y_2_ colorModeToggle_GEl4"><button class="clean-btn toggleButton_ooYU toggleButtonDisabled_rz6k" type="button" disabled="" title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_Nriq lightToggleIcon_Jf8_"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_Nriq darkToggleIcon_f8Yp"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_Nriq systemToggleIcon_xi5t">
14<path fill="currentColor" d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"></path></svg></button></div><div class="navbarSearchContainer_LaTy"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="theme-layout-main main-wrapper mainWrapper_n5r4"><main class="container container--fluid margin-vert--lg"><div class="row mdxPageWrapper_NGfa"><div class="col col--8"><article><header><h1>Get help</h1></header>
15<p>Got issues, questions, suggestions? Please read this page carefully to understand how you can get help working with RestSharp.</p>
16<div class="theme-admonition theme-admonition-tip admonition_L4je alert alert--success"><div class="admonitionHeading_r2Pm"><span class="admonitionIcon_jTjQ"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_ZX3I"><p>You can also support maintainers and motivate them by contributing via <a href="https://github.com/sponsors/restsharp" target="_blank" rel="noopener noreferrer" class="">GitHub Sponsors</a>.</p></div></div>
17<h2 class="anchor anchorTargetStickyNavbar_hDQi" id="questions">Questions<a href="#questions" class="hash-link" aria-label="Direct link to Questions" title="Direct link to Questions" translate="no">​</a></h2>
18<p>The most effective way to resolve questions about using RestSharp is StackOverflow.</p>
19<p>RestSharp has a large user base. Tens of thousands of projects and hundreds of thousands of developers
20use RestSharp on a daily basis. So, asking questions on <strong>StackOverflow</strong> with <a href="https://stackoverflow.com/questions/tagged/restsharp" target="_blank" rel="noopener noreferrer" class="">restsharp</a> tag
21would most definitely lead you to a solution.</p>
22<div class="theme-admonition theme-admonition-warning admonition_L4je alert alert--warning"><div class="admonitionHeading_r2Pm"><span class="admonitionIcon_jTjQ"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_ZX3I"><p>Please do not use GitHub issues to ask question about using RestSharp.</p></div></div>
23<h2 class="anchor anchorTargetStickyNavbar_hDQi" id="discussions">Discussions<a href="#discussions" class="hash-link" aria-label="Direct link to Discussions" title="Direct link to Discussions" translate="no">​</a></h2>
24<p>We have a <a href="https://groups.google.com/group/restsharp" target="_blank" rel="noopener noreferrer" class="">mail list</a> at Google Groups dedicated to discussions about
25using RestSharp, feature proposals and similar topics. It is perfectly fine to
26ask questions about using RestSharp at that group too.</p>
27<p>Please check the group and engage with the community if you feel a need
28to discuss things that you struggle with or want to improve.</p>
29<h2 class="anchor anchorTargetStickyNavbar_hDQi" id="bugs-and-issues">Bugs and issues<a href="#bugs-and-issues" class="hash-link" aria-label="Direct link to Bugs and issues" title="Direct link to Bugs and issues" translate="no">​</a></h2>
30<p>
30The last resort to get help when you experience some unexpected behaviour,
31a crash or anything else that you consider a bug, is submitting an issue
32at our GitHub repository.</p>
33<div class="theme-admonition theme-admonition-warning admonition_L4je alert alert--warning"><div class="admonitionHeading_r2Pm"><span class="admonitionIcon_jTjQ"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_ZX3I"><p><strong>Do not ignore our contribution guidelines</strong>, otherwise you risk your issue to be
34closed without being considered. Respect the maintainers, be specific and provide
35as many details about the issue as you can.</p></div></div>
36<p>Ensure you provide the following in the issue:</p>
37<ul>
38<li class="">Expected behaviour</li>
39<li class="">Actual behaviour</li>
40<li class="">Why do you think it is an issue, not a misunderstanding</li>
41<li class="">How the issue can be reproduced: a repository or at least a code snippet</li>
42<li class="">If RestSharp unexpectedly throws an exception, provide the stack trace</li>
43</ul>
44<h2 class="anchor anchorTargetStickyNavbar_hDQi" id="contributing">Contributing<a href="#contributing" class="hash-link" aria-label="Direct link to Contributing" title="Direct link to Contributing" translate="no">​</a></h2>
45<p>Although issues are considered as contributions, we strongly suggest helping
46the community by solving issues that you experienced by submitting a pull request.</p>
47<p>Here are contribution guidelines:</p>
48<ul>
49<li class="">Make each pull request atomic and exclusive; don&#x27;t send pull requests for a laundry list of changes.</li>
50<li class="">Even better, commit in small manageable chunks.</li>
51<li class="">Use the supplied <code>.editorconfig</code> file to format the code.</li>
52<li class="">Any change must be accompanied by a unit test covering the change.</li>
53<li class="">New tests are preferred to use FluentAssertions.</li>
54<li class="">No regions.</li>
55<li class="">No licence header for tested.</li>
56<li class="">Code must build for .NET Standard 2.0, .NET 5, and .NET 6.</li>
57<li class="">Test must run on .NET 6.</li>
58<li class="">Use <code>autocrlf=true</code> (<code>git config --global core.autocrlf true</code>)</li>
59</ul>
60<h2 class="anchor anchorTargetStickyNavbar_hDQi" id="common-issues">Common issues<a href="#common-issues" class="hash-link" aria-label="Direct link to Common issues" title="Direct link to Common issues" translate="no">​</a></h2>
61<p>Before opening an issue on GitHub, please check the list of known issues below.</p>
62<h3 class="anchor anchorTargetStickyNavbar_hDQi" id="content-type">Content type<a href="#content-type" class="hash-link" aria-label="Direct link to Content type" title="Direct link to Content type" translate="no">​</a></h3>
63<p>One of the mistakes developers make when using RestSharp is setting the <code>Content-Type</code> header manually.
64Remember that in most of the usual scenarios setting the content type header manually is not required, and it might be harmful.</p>
65<p>RestSharp sets the content type header automatically based on the request type.
66You might want to override the request body content type, but the best way to do it is to supply the content type to the body parameter itself.
67Functions for adding the request body to the request have overloads, which accept content type. For example</p>
68<div class="language-csharp codeBlockContainer_NY4W theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_FRkK"><pre tabindex="0" class="prism-code language-csharp codeBlock_ecQm thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_Xp1x"><div class="token-line" style="color:#000000"><span class="token plain">request</span>
68<span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token function" style="color:rgb(0, 0, 255)">AddStringBody</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">jsonString</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> ContentType</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">Json</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token punctuation" style="color:rgb(4, 81, 165)">;</span><br></div></code></pre></div></div>
69<h3 class="anchor anchorTargetStickyNavbar_hDQi" id="setting-the-user-agent">Setting the User Agent<a href="#setting-the-user-agent" class="hash-link" aria-label="Direct link to Setting the User Agent" title="Direct link to Setting the User Agent" translate="no">​</a></h3>
70<p>Setting the user agent on the request won&#x27;t work when you use <code>AddHeader</code>.</p>
71<p>Instead, please use the <code>RestClientOptions.UserAgent</code> property.</p>
72<h3 class="anchor anchorTargetStickyNavbar_hDQi" id="empty-response">Empty response<a href="#empty-response" class="hash-link" aria-label="Direct link to Empty response" title="Direct link to Empty response" translate="no">​</a></h3>
73<p>We regularly get issues where developers complain that their requests get executed
74and they get a proper raw response, but the <code>RestResponse&lt;T&gt;</code> instance doesn&#x27;t
75have a deserialized object set.</p>
76<p>In other situations, the raw response is also empty.</p>
77<p>All those issues are caused by the design choice to swallow exceptions
78that occur when RestSharp makes the request and processes the response. Instead,
79RestSharp produces so-called <em>error response</em>.</p>
80<p>You can check the response status to find out if there are any errors.
81The following properties can tell you about those errors:</p>
82<ul>
83<li class=""><code>IsSuccessful</code></li>
84<li class=""><code>ResponseStatus</code></li>
85<li class=""><code>StatusCode</code></li>
86<li class=""><code>ErrorMessage</code></li>
87<li class=""><code>ErrorException</code></li>
88</ul>
89<p>It could be that the request was executed and you got <code>200 OK</code> status
90code back and some content, but the typed <code>Data</code> property is empty.</p>
91<p>In that case, you probably got deserialization issues. By default, RestSharp will just return an empty (<code>null</code>) result in the <code>Data</code> property.
92Deserialization errors can be also populated to the error response. To do that,
93set the <code>client.FailOnDeserializationError</code> property to <code>true</code>.</p>
94<p>It is also possible to force RestSharp to throw an exception.</p>
95<p>If you set <code>client.ThrowOnDeserializationError</code>, RestSharp will throw a <code>DeserializationException</code>
96when the serializer throws. The exception has the internal exception and the response.</p>
97<p>Finally, by setting <code>ThrowOnAnyError</code> you can force RestSharp to re-throw any
98exception that happens when making the request and processing the response.</p></article></div><div class="col col--2"><div class="tableOfContents_nHmv thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#questions" class="table-of-contents__link toc-highlight">Questions</a></li><li><a href="#discussions" class="table-of-contents__link toc-highlight">Discussions</a></li><li><a href="#bugs-and-issues" class="table-of-contents__link toc-highlight">Bugs and issues</a></li><li><a href="#contributing" class="table-of-contents__link toc-highlight">Contributing</a></li><li><a href="#common-issues" class="table-of-contents__link toc-highlight">Common issues</a><ul><li><a href="#content-type" class="table-of-contents__link toc-highlight">Content type</a></li><li><a href="#setting-the-user-agent" class="table-of-contents__link toc-highlight">Setting the User Agent</a></li><li><a href="#empty-response" class="table-of-contents__link toc-highlight">Empty response</a></li></ul></li></ul></div></div></div></main></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="row footer__links">
98<div class="theme-layout-footer-column col footer__col"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/intro">Documentation</a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/restsharp" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_l17c"><use href="#theme-svg-external-link"></use></svg></a></li><li class="footer__item"><a href="https://discordapp.com/invite/docusaurus" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_l17c"><use href="#theme-svg-external-link"></use></svg></a></li><li class="footer__item"><a href="https://twitter.com/RestSharp" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_l17c"><use href="#theme-svg-external-link"></use></svg></a></li></ul></div><div class="theme-layout-footer-column col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/RestSharp/RestSharp" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-label="(opens in new tab)" class="iconExternalLink_l17c"><use href="#theme-svg-external-link"></use></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2026 .NET Foundation. Built with Docusaurus.</div></div></div></footer></div>
99<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v31edd6df95cf4e85bb4c19e7a9bdbcba1788362987495" integrity="sha512-iIg7k2xntmwu6/uSb5tpc/hySgZc4eoL31yB29W6tJFo2akwjPWcEqnCEdJvGexCL0KEQwVYv5BlowfhVz26hg==" data-cf-beacon='{"version":"2024.11.0","token":"eaa575d61e6a4a69b7049ad3176652b3","r":1,"spa":2}' crossorigin="anonymous"></script>
99
100</body>
101</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.