protocurl icon indicating copy to clipboard operation
protocurl copied to clipboard

How to send file as payload ?

Open Ishmeet opened this issue 1 year ago • 6 comments

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.

Ishmeet avatar Feb 22 '24 16:02 Ishmeet

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 avatar Feb 23 '24 17:02 GollyTicker

@Ishmeet ping 😇

GollyTicker avatar Feb 27 '24 13:02 GollyTicker

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

Ishmeet avatar Feb 27 '24 13:02 Ishmeet

@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.

GollyTicker avatar Feb 27 '24 16:02 GollyTicker

@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

Ishmeet avatar Feb 28 '24 04:02 Ishmeet

@Ishmeet

Did you manage to take a look at it? 😇

GollyTicker avatar Mar 20 '24 14:03 GollyTicker

@GollyTicker , I finally got time to work on this. Would appreciate ur review https://github.com/qaware/protocurl/pull/181

Ishmeet avatar May 10 '24 11:05 Ishmeet

Thanks for your effort! I took a look at it! :tada:

GollyTicker avatar May 10 '24 11:05 GollyTicker