# Full format of POST request to Photon function

**URL:** <https://community.particle.io/t/full-format-of-post-request-to-photon-function/22309>\
**Category:** Firmware\
**Created:** [April 21, 2016, 9:23pm UTC](https://community.particle.io/t/full-format-of-post-request-to-photon-function/22309 "2016-04-21T21:23:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmosk](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jmosk/32/6282_2.png) [@jmosk](https://community.particle.io/u/jmosk)\
**Post date:** [April 21, 2016, 9:23pm UTC](https://community.particle.io/t/full-format-of-post-request-to-photon-function/22309/1 "2016-04-21T21:23:57Z")

</div>

I wish to have a JavaScript running under node.js post a form to a Photon’s function to activate it and return a status. Can someone document an example of all the lines sent via HTTP that would call a photon function called “photon-function”. I have used curl to verify that the photon function is working properly from a call from a remote site. But I am not sure what the format of the header and body should be so I can have the JavaScript create that format.

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [April 21, 2016, 9:30pm UTC](https://community.particle.io/t/full-format-of-post-request-to-photon-function/22309/2 "2016-04-21T21:30:18Z")

</div>

Any reason against using the javascript SDK, which was made to do these exact things?  
[https://docs.particle.io/reference/javascript/#callfunction](https://docs.particle.io/reference/javascript/#callfunction)

There's always this (amazing) tutorial if you're keen on doing it manually:

> [@Tutorial: Spark Variable and Function on One Web Page](https://community.particle.io/t/tutorial-spark-variable-and-function-on-one-web-page/4181):
>
> Let’s say you have a Spark core with both a Spark variable and a Spark function. In my case, I have the world’s simplest servo control sketch, using the nice miniature servo in the Spark Maker Kit. Using these parts, we will build a servo that you can control from a web page anywhere and monitor the position of the servo too! Here’s a preview of the finished tutorial: [image] There is a coarse adjust slider, two fine adjust buttons, and the current position of the servo is displayed. That…

Considering you're suing Node.js, and there's a library written for it, I'd suggest using that though...
