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

Add HTTP as cell type #3126

Closed
Regenhardt opened this issue Aug 8, 2023 · 7 comments
Closed

Add HTTP as cell type #3126

Regenhardt opened this issue Aug 8, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@Regenhardt
Copy link

Is your feature request related to a problem? Please describe.

I love how simple the .dib file is internally and now I'm bothered by how complicated it is to keep postman collections in sync with a dotnet solution and by how complicated the postman collection export is in a git diff.

Describe the solution you'd like

Add .http file functionality as a cell type to .dib files (don't know how the language/kernel would be called, I guess it's just plain HTTP because that's what the .http file contains?).

The result could either be rendered below the cell, or maybe we can find a way of putting it into a variable that contains the response as machine readable data for following cells (maybe $return for the last return value like C#, or $0 like a browser console? This might be for another issue).

Variables of prior cells could be used in the {{usualSyntax}}, but in case of complex types it's complicated to choose what to do to convert it to a string that makes sense. Although I guess this could just be some [Object object] kind of broken as in this case a user can easily deconstruct the complex object to primitive objects in a prior cell.

Describe alternatives you've considered

Use C# in the .dib file to send requests but that is too much work compared to postman.

Use a dotnet test framework like MSTest to build E2E-Tests. This is quite complicated for quick iterations with the whole compilation and project structure and doesn't give me the same disconnect from the application where I can just call a webservice in the void and see what happens.

@Regenhardt Regenhardt added the enhancement New feature or request label Aug 8, 2023
@jonsequitur
Copy link
Contributor

Of possible interest: #3122.

You can get this functionality by installing the HTTP kernel from this NuGet package. The linked PR and upcoming PRs in this area include a number of improvements to the experience. We're considering whether to make it one of the default kernels in the list out of the box.

@fravelgue
Copy link

Is it possible to get the HTTP response output in a variable too?

@jonsequitur
Copy link
Contributor

Yes, that feature is coming.

@fravelgue
Copy link

@jonsequitur Do you know of any issue to follow up on?

@jonsequitur
Copy link
Contributor

This is now supported but variable sharing isn't (yet).

image

@frankenstein91
Copy link

@jonsequitur
Are you able to fix https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode and remove HTTP Variable sharing?

@jonsequitur
Copy link
Contributor

Variable sharing is intended to work for the HTTP kernel but there's a bug. (#3522)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants