interactive icon indicating copy to clipboard operation
interactive copied to clipboard

Add HTTP as cell type

Open Regenhardt opened this issue 2 years ago • 3 comments

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 avatar Aug 08 '23 20:08 Regenhardt

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.

jonsequitur avatar Aug 09 '23 02:08 jonsequitur

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

fravelgue avatar Jan 16 '24 17:01 fravelgue

Yes, that feature is coming.

jonsequitur avatar Jan 23 '24 00:01 jonsequitur

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

fravelgue avatar Apr 18 '24 08:04 fravelgue

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

image

jonsequitur avatar Apr 18 '24 16:04 jonsequitur

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

frankenstein91 avatar Apr 22 '24 13:04 frankenstein91

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

jonsequitur avatar Jun 10 '24 22:06 jonsequitur