Skip to content

V109 #2010

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

Merged
merged 3 commits into from
Mar 4, 2023
Merged

V109 #2010

merged 3 commits into from
Mar 4, 2023

Conversation

EdLichtman
Copy link
Contributor

Description

Cherry-Picked Commit of pull request 2002.
Includes: Better Documentation, and some tests for reliability and self-documentation

Purpose

This pull request is a:

  • [ x ] Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [ X ] I have added tests that prove my fix is effective or that my feature works
  • [ X ] I have added necessary documentation (if appropriate)

Sorry, something went wrong.

@tacosontitan
Copy link
Contributor

This PR also considers the prior feedback from PR #2002 to utilize the code tag in the documentation.

This was supposed to be included with my review above.

@EdLichtman
Copy link
Contributor Author

How do I merge? it says you approved the changes, but it also says it requires approval?

@alexeyzimarev
Copy link
Member

It's me who does the merge :)

@EdLichtman
Copy link
Contributor Author

EdLichtman commented Feb 23, 2023

I tested the Koala test locally and it seems to be a transient error on the build server. Could it be due to request caps?

Would it be a good idea to change the PostAsync to use ExecuteAsync so we could publish the responseMessage instead?

Something like:

        const string filename = "Koala.jpg";

        var path = Path.Combine(_path, "Assets", filename);

        var request  = new RestRequest("upload").AddFile("file", path);
        var response = await _client.ExecutePostAsync<UploadResponse>(request);

        var expected = new UploadResponse(filename, new FileInfo(path).Length, true);

        response.Data.Should().BeEquivalentTo(expected, 
            $"Error making request. Data was: {JsonConvert.SerializeObject(response.Data)}.Response Status was:{response.StatusCode}. Reason: {response.ErrorMessage}");`

I have the code ready to go, but I wasn't sure if there was a specific reason this test was using PostAsync rather than ExecutePost.

@alexeyzimarev
Copy link
Member

I will check, it was not failing before. Weird.

@alexeyzimarev alexeyzimarev merged commit 90e70fc into restsharp:v109 Mar 4, 2023
alexeyzimarev added a commit that referenced this pull request Mar 12, 2023
* Added .NET Framework 471 as a target. .NET 5 is out
* Fix the media type issue with .NET 7 #1969
* `IRestClient` Interface is back
* String type for ContentType
* Added Authenticator to RestRequest
* Made Options immutable to make the client thread-safe
* Ignore exceptions parsing response cookies (#2015)
* V109 (#2010)
* Added a simple factory with opt-in

---------

Co-authored-by: Francesc Castells <fcastells76@gmail.com>
Co-authored-by: Francesc Castells <francesc.castells@sermo.com>
Co-authored-by: Edward Lichtman <E.Lichtman2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants