loading...

Discussion on: HTTP request with ES6 tagged templates

Collapse
vaheqelyan profile image
Vahe Author

But what about this

post`https://example.com/api.createMsg?${{apiKey: config.apiKey}} --content-json --accept-json`

Perhaps we can include both examples?

Collapse
kenbellows profile image
Ken Bellows

All depends on how complex you want your parser to be, I guess. Personally I'm not sold on a shell-command-like format, especially considering that it would be kind of annoying to build that string in JS I think. Would you specify just certain header options that can be specified with this shorthand?

I personally like the Header-Name: header-value syntax because it's very easy to parse into an Object, and its very easy to serialize an Object into that format. But it's all subjective; it's just a prototype, right? Have fun with it, try it out, use it for a project, see what you like and dislike

Thread Thread
vaheqelyan profile image
Vahe Author

I agree with you