Intercooler request metadata to a header?

26 views
Skip to first unread message

Carson Gross

unread,
Oct 16, 2018, 1:30:17 PM10/16/18
to intercooler-js
All,

I am considering moving the metadata for an intercooler request to a header (e.g. X-IC-Metadata) rather than embedding it as parameters.  For example, ic-element and ic-target-id would end up in a header (as JSON) rather than in the parameters.

This feels cleaner to me.  The use of parameters was due to convienence and was done before I had really thought much about it.

The downside of this is that you would need to parse JSON on the server side to get at this information.

What do people think of this change?  Does this seem like the right thing?

I would include a meta directive to include the meta-data as parameters so people could continue to use that style as well.

Cheers,
Carson

Keyur Shah

unread,
Oct 16, 2018, 4:27:31 PM10/16/18
to intercooler-js
that sounds great!

Matt Burton

unread,
Oct 16, 2018, 4:27:37 PM10/16/18
to intercooler-js
Makes sense to me - I've always looked at those parameters as part of the internal workings of Intercooler and have not taken a dependency on them - moving them to a header will definitely clean things up. The only thing I can think of would be a debug scenario looking at web server logs where for some reason I'd need to figure out whether the call was from Intercooler or a direct call - I'd lose that context from the URL being accessed, but that's easily worked around I suppose, and I haven't ever been in that situation yet myself.

Thanks,
Matt

Justin Sampson

unread,
Oct 16, 2018, 4:36:33 PM10/16/18
to Carson Gross, intercooler-js

Yep, using headers sounds like the right thing to do. It will declutter the parameter namespace and ensure that the application has full control of the parameters.

 

However, why a single header holding JSON rather than multiple headers (one per current parameter)?

 

-Justin

--
You received this message because you are subscribed to the Google Groups "intercooler-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intercooler-j...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carson Gross

unread,
Oct 16, 2018, 6:12:02 PM10/16/18
to intercooler-js, Justin Sampson, Carson Gross
Yeah, I was thinking about that option.  But then that would be a lot of headers, and the names would all be "X-IC-...".  Kinda sloppy feeling.

Hmm.

Cheers,
Carson
Reply all
Reply to author
Forward
0 new messages