Code Monkey home page Code Monkey logo

Comments (8)

fastdivision avatar fastdivision commented on May 28, 2024 3

@stephen-cernota I have a WIP branch for a .NET Core client that I'll add as a PR shortly. The only thing remaining is updating all of the specs to use a new HTTP mocking library. You should be able to use Execute() with the latest version of RestSharp (106.x). RestSharp.NetCore on NuGet is an unofficial package and out of date, I would avoid using it.

from taxjar.net.

fastdivision avatar fastdivision commented on May 28, 2024

I'll try to get around to this in the very near future :-) Appreciate the feedback!

from taxjar.net.

togosh avatar togosh commented on May 28, 2024

Any updates on this?

from taxjar.net.

togosh avatar togosh commented on May 28, 2024

I found a .NET Core NuGet package for RestSharp, not sure if it is legit:
https://www.nuget.org/packages/restsharp.netcore/105.2.3

Ill report back if I get things to work

from taxjar.net.

togosh avatar togosh commented on May 28, 2024

The only problem I ran into was that this restsharp.netcore package didnt have .Execute() function and I had to use .ExecuteAsync(), Im still not fully comfortable with asynchronous functionality, please anyone help if you can, but the below code is working for me so far:

A

var resTask = GetResponseContentAsync(req);  
var res = resTask.Result;

B

var res = new RestResponse();
        Task.Run(async () =>
        {
            res = await GetResponseContentAsync(req) as RestResponse;
        }).Wait();

Extra Function

Task<IRestResponse> GetResponseContentAsync(IRestRequest request)
        {
            var tcs = new TaskCompletionSource<IRestResponse>();
            this.apiClient.ExecuteAsync(request, response => {
                tcs.SetResult(response);
            });
            return tcs.Task;
        }

from taxjar.net.

togosh avatar togosh commented on May 28, 2024

Awesome! Thank you!

from taxjar.net.

claytondus avatar claytondus commented on May 28, 2024

I have also written a fully async .NET Standard library for TaxJar, Claytondus.TaxJar, based on Flurl.Http. I take PRs for missing features (I am not aware of any) or bugs.
https://github.com/claytondus/Claytondus.TaxJar

from taxjar.net.

fastdivision avatar fastdivision commented on May 28, 2024

.NET Core support added in #7, releasing v2.0 shortly!

from taxjar.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.