postman-code-generators
postman-code-generators copied to clipboard
Add Support for C# HttpClient code gen
Is your feature request related to a problem? Please describe.
I would love if Postman had the ability to generate code for making HTTP calls using the built in HttpClient in System.Net.Http. Some companies have requirement to not use outside packages so using only things built into .NET could be helpful.
Describe the solution you'd like
I would like it to generate code as close to the best practices as described by Microsoft and shown in this example.
Additional context
I am going to personally start working on this and will hopefully be referencing this issue in a pull request soon.
@justindbaur any updates on this? This would be an awesome feature!
@Misiu Yeah sorry. I did kinda give up on this for a while but if there is some more interest I think I should be able to finish it up. Currently I am failing two tests but I think I am close. I will try to make it a little bit more of a priority and try to have it done within a few weeks.
Failing tests:
should generate snippet for emptyFormdataCollection request: POST empty Formdata
should generate snippet for formdataCollection request: POST multipart/form-data with text parameters
Thank you for the update 🙂
@Misiu Since you had shown some interest in it. I have just finished the implementation in #453. I was wondering if you could take a look at the samples and see if they look good to you. I want it to be a good introduction for people so I want it to be as close to how people would use it without getting to crazy.
does it release now?
@yuzd It will need to be reviewed, approved, and merged by someone at postman. It doesn't look like a lot of resources are directed at this repo so it might take some time. I will do my best to be responsive to any issues with the pull request when a review comes my way though. Probably best to be subscribed to the linked PR.
thanks ! this is great job for csharp
@umeshp7 we need this. Can be merged and released?
Let me know how I can help @umeshp7
With the breaking changes introduced in RestSharp v107, and Postman not supporting RestSharp code generation for version 107 or higher, having HttpClient code generation in Postman would be a great addition to the software.