Creating an API SDK with Refit | ASP.NET Core 5 REST API Tutorial 23

preview_player
Показать описание

Hello everybody I'm Nick and in this video I will show you how you can create an SDK, also known as a client, for our REST API. It is a really straightforward process and we will be using Refit wihch is a package that automatically does most of the job for us.

Don't forget to comment, like and subscribe :)

Social Media:

#tutorial #rest #api #refit
Рекомендации по теме
Комментарии
Автор

I usually use Refit to create an SDK for my API. That way I can share it, or I can use it in my other services that consume the API. But the cool think about it, is that I also test against my SDK Project (no my API project) so I force myself to update my SDK to do integration tests. I also use an Odata client to do integration test against my Odata endpoints.
Sharing just in case it helps someone.

facundo
Автор

Great stuff! Some ideas I would like you to cover in future videos: generating/exposing swagger.yaml file, translation of api response messages based on client culture, something more about versioning (how you want to maintain your code, maybe its time to make v2).

aleksanderponiatowski
Автор

Hi Nick :-)
I think it would be very, very helpful - even vor advanced coders - to see your keystrokes and the shortcuts you use. Your coding productivity is amazing, imho.
Also the content is highly valuable! Thank you so much =)

BugTrampler
Автор

Hi Nick,
You are making great tutorials. I wonder how would you implement refresh tokens?

bgatti
Автор

Would love to see this extended with OData

andrewwilinski
Автор

Yeah, Refit is much more Retrofit from Android and I love that approach 🤙

pirati
Автор

Awesome videos! Since the swagger allow us to auto-generate c# client via Nswag, I just wondering what's the differences compared to using refit to generate SDK? I'm confused because swagger can auto-generate client without even specifying the interface, so why what's the benefit to use refit here?

yimenghu
Автор

Hey Nick thanks for your great video. I cannot navigate to PostController in debug mode. for example I don't know whether Get() method returned a value or not. It just go out of debug mode. the point is that if I execute only the Add() method it save a record in the database successfully but after that visual studio go go out of debug mode again.

tmati
Автор

Hey! :) When u defining routes (for example api/vi/post) in ITweetbookApi why You don't use routes from ApiRoutes.cs file? We cannot/shouldn't use it in the context of newly added SDK project?

krzysztofurban
Автор

What if we get AuthFailedResponse instead of AuthSouccesResponse? How can we read the error messages than? Can Refit handle that?

patrikfajnar
Автор

Great tutorial series! moving the Contracts to its own project seems to have broken Docker support. Getting an error Contract project not found when doing a build with Docker compose

rahmanamyo
Автор

anyone knows why the last method, the return of the delete, instead of is Task<ApiResponse<string>> ?

amandamata
Автор

Hi nick, do you have a tutorial about asp.net core 2.2 (or later) and discussing how to do multiple select for many-to-many relationship. For example, between Student and Course. One student can be referenced by many courses and one course can be referenced by many students.

I am a bit confused with how to implement the multi select listbox, view model, etc.

I hope you can give such a new tutorial (if it is not already available). Thank you!

rahmatabadi
Автор

Do we have to create versions folder for sdk as well?

_samirdahal
Автор

How can I achieve this using CQRS (MediaR)... in this case do I need to separate the commands and queries in another project as well?

jeffersantosss
Автор

I generally use OpenAPI/Swagger with something like NSwag or AutoRest to generate a client but this looks like a really neat approach. Do you know of any way of taking an existing swagger file and generating the Sdk interfaces?

danieljayne
Автор

Nick siempre me salvas el culo, te amo <3

diale
Автор

Hi,
Thanks for your video,
Is refit like Restease package?

mehdihadeli
Автор

When I used ApiRoutes to set routes in sdk's interfaces, I got runtime error, like 'provide refit's interface'. But it's a string... When a set routes as a string, it works. I don't know why it is so.

MrMadcatsam