Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Option to add Interceptors on Client Level #2118

Merged
merged 36 commits into from
Sep 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ef1dddd
feature: Added Implementation for Interceptors
fseidl-bauradar Apr 4, 2023
b8d7ec8
feature: Added Interfaces for Interceptors
fseidl-bauradar Apr 4, 2023
38450ff
Merge branch 'restsharp:dev' into dev
fseidl-bauradar Apr 4, 2023
25f5d65
fix: Corrected Comment
fseidl-bauradar Apr 4, 2023
85b6c79
fix: Configured to wait for result
fseidl-bauradar Apr 4, 2023
9d7b59f
refactor: Renamed Class name to go allong with Class Name conventions
fseidl-bauradar Apr 4, 2023
86772f5
Update RestSharp.sln
fseidl-bauradar Apr 4, 2023
651dabc
Merge branch 'restsharp:dev' into dev
fseidl-bauradar Apr 4, 2023
5c91edd
Removed ConsoleTest from Repository
fseidl-bauradar Apr 4, 2023
b9f4082
Feature: Added Base Interceptor to simplify definition of Interceptors
fseidl-bauradar Apr 4, 2023
b7ed190
Merge branch 'restsharp:dev' into dev
fseidl-bauradar Apr 4, 2023
fa2662e
Fix: Added virtual keyword to allow overriding the functions in deriv…
fseidl-bauradar Apr 4, 2023
6241787
Synchronized Fork with RestSharp Repository
fseidl-bauradar Apr 19, 2023
1cd427a
Solved Merge conflict
fseidl-bauradar Apr 19, 2023
afb6ff3
refactor: Removed Interfaces
fseidl-bauradar May 4, 2023
56086d6
refactor: Removed Interfaces
fseidl-bauradar May 4, 2023
a13ec64
refactor: Moved to Abstract Base Class
fseidl-bauradar May 4, 2023
7d26494
refactor: Use Base class as Element
fseidl-bauradar May 4, 2023
a930f98
fix: Added UnitTest to Dependencies
fseidl-bauradar May 4, 2023
9312863
sychronized with upstream
fseidl-bauradar May 4, 2023
adf131d
refactor: Adde nuget.config to gitignore
fseidl-bauradar May 4, 2023
b31aee4
Merge branch 'restsharp:dev' into dev
fseidl-bauradar May 12, 2023
7cec99f
Merge branch 'restsharp:dev' into dev
fseidl-bauradar Jun 19, 2023
565f72e
refactor: Moved OnBeforeDeserialization into async context one layer …
fseidl-bauradar Jun 28, 2023
f5616cd
refactor: Moved Interceptor Calls and surrounding Code out of try,cat…
fseidl-bauradar Jun 28, 2023
c26b6a4
refactor: Added Test for Interceptor
fseidl-bauradar Jun 28, 2023
36e688f
refactor: Adde global.json to .gitignore
fseidl-bauradar Jun 28, 2023
25b2fb4
refactor: ConfigureAwait(false) not needed to return to origin thread
fseidl-bauradar Jun 28, 2023
6f39867
refactor: Remove global.json from gitignore
fseidl-bauradar Jul 19, 2023
721a9b0
refactor: Changed back Project guid
fseidl-bauradar Jul 19, 2023
08f9be4
refactor: Removed System.Threading.Tasks depencency from RestSharp.cs…
fseidl-bauradar Jul 19, 2023
ac79e2b
refactor: Removed xunig.assert depencency from RestSharp.InteractiveT…
fseidl-bauradar Jul 19, 2023
4ad71a4
refactor: Readded global.json
fseidl-bauradar Jul 19, 2023
901e5c3
refactor: Undo renaming class user to User
fseidl-bauradar Jul 19, 2023
c2d15b7
Merge branch 'dev' of https://github.com/fseidl-bauradar/RestSharp in…
fseidl-bauradar Jul 19, 2023
163ce73
Merge branch 'dev' into dev
alexeyzimarev Sep 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feature: Added Base Interceptor to simplify definition of Interceptors
fseidl-bauradar committed Apr 4, 2023
commit b9f408273959e3701df0104d15320945cf6e1fa8
37 changes: 37 additions & 0 deletions src/RestSharp/Interceptors/BaseInterceptor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright (c) .NET Foundation and Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

namespace RestSharp.Interceptors;

/// <summary>
/// Base Interceptor
/// </summary>
public class BaseInterceptor : IInterceptor {
public ValueTask InterceptBeforeSerialization(RestRequest request) {
return new();
}

public ValueTask InterceptBeforeRequest(HttpRequestMessage req) {
return new();
}

public ValueTask InterceptAfterRequest(HttpResponseMessage responseMessage) {
return new();
}

public ValueTask InterceptBeforeDeserialize(RestResponse request) {
return new();
}
}