I realize that fundamentally I'm probably going about this the wrong way so I'm open to any pushes in the right direction.
I'm trying to use the HipChat API to send a notification to a room like so:
https://www.hipchat.com/docs/api/method/rooms/message
I'm trying to build the URL in the example with a js object's parameters, so basically I'm trying to convert this:
var hipChatSettings = {
format:"json",
auth_token:token,
room_id: 1,
from: "Notifications",
message: "Message"
}
To this:
Something like this could work for you
If you can't depend on ECMAScript 5, you can use a simple for loop
try with this method:
Warning: newish JavaScript. If you want it to work on ancients, shim or rewrite into
for
.You should check this jQuery.param function.
ES6 version, can do really nested objects with arrays