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

How to send file as payload ? #173

Open
Ishmeet opened this issue Feb 22, 2024 · 8 comments
Open

How to send file as payload ? #173

Ishmeet opened this issue Feb 22, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@Ishmeet
Copy link

Ishmeet commented Feb 22, 2024

I tried -d @payload.json , but it didn't work

protocurl -I . -i ..ARequest -o ..AResponse -u localhost:9443/send -d @payload.json
Warning: Couldn't read data from file "payload.json", this makes an 
Warning: empty POST.
@GollyTicker
Copy link
Collaborator

GollyTicker commented Feb 23, 2024

Hi @Ishmeet ,

protocurl currently doesn't support that. It currently only accepts the payload as a cmd-arg string.

In shells you can instead use this to pipe the contents of a file into the cmd-arg string.

protocurl -d "$(cat payload.json)" <remaining args ...>

However, would you think, that having the curl-like cmd-arg via -d @<filepath> would be a good user improvement?

If so, we can extend protocurl to cover this.

@GollyTicker GollyTicker added the enhancement New feature or request label Feb 23, 2024
@GollyTicker
Copy link
Collaborator

@Ishmeet ping 😇

@Ishmeet
Copy link
Author

Ishmeet commented Feb 27, 2024

@GollyTicker ,
Yes definitely, it will be good improvement to add -d @<filepath>.

@GollyTicker
Copy link
Collaborator

GollyTicker commented Feb 27, 2024

@Ishmeet . Ok

Unfortunately, I have not much time atm and in near future.

Can you perhaps add it yourself? You'll have it much earlier then.

What do you think? The repository is well documented. Nevertheless, if you have questions you can ask.

@Ishmeet
Copy link
Author

Ishmeet commented Feb 28, 2024

@Ishmeet . Ok

Unfortunately, I have not much time atm and in near future.

Can you perhaps add it yourself? You'll have it much earlier then.

What do you think? The repository is well documented. Nevertheless, if you have questions you can ask.

I'll try

@GollyTicker
Copy link
Collaborator

@Ishmeet

Did you manage to take a look at it? 😇

@Ishmeet
Copy link
Author

Ishmeet commented May 10, 2024

@GollyTicker , I finally got time to work on this.
Would appreciate ur review #181

@GollyTicker
Copy link
Collaborator

Thanks for your effort! I took a look at it! 🎉

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

No branches or pull requests

2 participants