3.70Clearing Request Content
Created on Aug 17, 2026~2 min read
When writing HTTP proxies or unit tests, sometimes you need to clear the already-set request content and its related configuration in one go. The framework provides the RemoveContent() method to achieve this.
HttpRequestBuilder.Post("https://furion.net/") .SetContent(new {}, "application/json", Encoding.UTF8) .RemoveContent();HttpRequestBuilder.Post("https://furion.net/") .SetContent(new MemoryStream(), "application/json", Encoding.UTF8) .RemoveContent(disposeRawContent: true); // Dispose the raw content when it is removedAfter calling RemoveContent(), ContentType, ContentEncoding, RawContent, MultipartFormDataBuilder, and OmitContentType are all reset to their initial state; if RawContent implements IDisposable and was previously added to the disposable list via AddDisposable(rawContent), this method also automatically removes it.
Based on the newly added merge logic, the documentation has been supplemented and adjusted as follows: