GroveStreams

Particle webhook HTTP HEADER425

ctmorrison private msg quote post Address this user
I noticed in your example that you include a HTTP HEADER for "Connection : close". I've never used this and wonder if this could explain why we're seeing higher BYTES IN than expected in one of the project on which I'm assisting. Thoughts???

Also, I see Content-Type : application/json and I haven't used this since all my info is being passed in the query string. Is it important to have this header (your example also does not pass data via JSON).

Thanks for the clarification!
Post 1 • IP   flag post
MikeMills private msg quote post Address this user
Connection:close is part of the header and will not impact your GS I/O billing metrics. Connection:Close tells our web server to not hold open a connection for that device. Our web server will only hold a connection open for 15 seconds maximum. You should always add Connection:close if the upload cycle is larger than 15 seconds. Adding it allows our system to have more connections available.

I'm not sure if we require Content-Type : application/json for the "all on the URL" feed put. Try your call without it and see if it still works.

Our Particle webhook settings are very precise and it took a lot of trial and error to come up with them. If you get one thing wrong, then the hook doesn't work and you have to recreate your webhook from scratch again. It would be ideal if Particle would let users edit an existing webhook!
Post 2 • IP   flag post
ctmorrison private msg quote post Address this user
Got it on the Connection:close. I'll add that to all my webhooks if it helps you folks. Thanks for the clarification.

I don't use the application/json header, so I know it's not required. I simply didn't know if it was advisable for some reason. All of our parameters are passed via the URL at this time. It's just way easier to program that way.

For what it's worth, I often build a text file in order to create my webhooks. I can then create it, delete it, edit the file and re-create it with ease via the CLI. The web console is handy...unless you want to change a webhook after it's created and then it's the target of bad language from me! FWIW.
Post 3 • IP   flag post
2572 3 3
Log in or sign up to compose a reply.
destitute