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

[Feature Request] Pipe Body before sending (for protobuf) #1619

Open
bmarwell opened this issue Aug 6, 2019 · 11 comments
Open

[Feature Request] Pipe Body before sending (for protobuf) #1619

bmarwell opened this issue Aug 6, 2019 · 11 comments
Labels
C-improvement Category: Improvement / Enhancement N-discussion Needs: Discussion needs-triage waiting-for-team

Comments

@bmarwell
Copy link

bmarwell commented Aug 6, 2019

  • Insomnia Version: Latest (Ubuntu SNAP)
  • Operating System: Ubuntu 18.04

Details

It would be nice feature if we were able to pipe the data from the body form (POST requests) through one or more external tools. That would enable protobuf support.

Maybe even ship with your own protobuf binary in the snap distribution.

Example

Example body:

myid: "test"
mycontent: "content"

Pipe command:

Either
${body} | protoc --encode=io.github.insomnia.ProtoClass -I../path/to/proto/definitions ProtoClass.proto | ${out}

or

protoc --encode=io.github.insomnia.ProtoClass -I../path/to/proto/definitions ProtoClass.proto < ${bodyFile} > ${outFile}

Related to #1311 which you probably haven't seen.
Would also enable proto, but you'd need to be able to load the JS proto definitions.

Thanks!

Use Cases

  • Testing any Protobuf+HTTP endpoint (non-gRPC, maybe later)
  • Testing any other binary protocol
  • Enabling encryption / decryption
@welcome
Copy link

welcome bot commented Aug 6, 2019

👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 🎁, please provide real
use cases that would benefit. 👪

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

@gschier
Copy link
Contributor

gschier commented Aug 7, 2019

You can almost make a request hook plugin that does this.

  1. Use getBodyText() to get the current body
  2. Find an NPM module to generate the protobuf binary
  3. Store the binary in a tmp folder
  4. Use setBodyFile(path: string) to tmp location (This method does not yet exist)

As you can see, most of the pieces are in place to do this, except the last step. There is currently only a setBodyText(txt: string) method which will not work with binary data.

Thoughts on this approach, if it were possible?

@stale
Copy link

stale bot commented Oct 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Bot: Stale Issue label Oct 6, 2019
@bmarwell
Copy link
Author

bmarwell commented Oct 6, 2019

Hi,

I do not really know how to apply the request hook plugin. Also, this seems a little cumbersome for creating a lot of requests. Have you tried it yourself?

@stale stale bot removed the stale Bot: Stale Issue label Oct 6, 2019
@stale
Copy link

stale bot commented Dec 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Bot: Stale Issue label Dec 5, 2019
@bmarwell
Copy link
Author

bmarwell commented Dec 6, 2019

Hello stale bot, this feature is hereby still requested.

@stale stale bot removed the stale Bot: Stale Issue label Dec 6, 2019
@gschier
Copy link
Contributor

gschier commented Dec 11, 2019

There, now it won't close

@gschier gschier added N-discussion Needs: Discussion and removed Accepted 👌 labels Dec 11, 2019
@gschier
Copy link
Contributor

gschier commented Dec 11, 2019

The reason I suggest a plugin is because it seems like it would be a fairly niche use case, and it would be really useful to be able to customize the integration with external tools.

@bmarwell
Copy link
Author

Sure, that would do. Sadly I don't know if I would be of any help. Thanks for looking into this! :)

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 2, 2021
@bmarwell
Copy link
Author

bmarwell commented Jun 2, 2021

tag needs-documentation

@stale stale bot removed the wontfix label Jun 2, 2021
@filfreire filfreire added the C-improvement Category: Improvement / Enhancement label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-improvement Category: Improvement / Enhancement N-discussion Needs: Discussion needs-triage waiting-for-team
Projects
None yet
Development

No branches or pull requests

3 participants