added payload to execution

* execution now contains payload for sending a body in POST/PUT calls
    * renamed data from execution to formData
<a href='#crh-start'></a><a href='#crh-data-%7B%22approved%22%3A%20%7B%22https%3A//github.com/TheBay0r%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%7D%7D%2C%20%22comments%22%3A%20%7B%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64163959%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%3Ashipit%3A%22%2C%20%22created_at%22%3A%20%222014-11-24T08%3A31%3A22Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%2C%20%7B%22body%22%3A%20%22We%20really%20need%20some%20documentation%20how%20proper%20API%20calls%20/%20workflows%20should%20look%20like%20with%20all%20possible%20parameters%20etc.%20%5Cr%5CnBut%20the%20executions%20itself%20looks%20nice%20so%20far%22%2C%20%22created_at%22%3A%20%222014-11-24T08%3A33%3A28Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/8627051%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/TheBay0r%22%7D%7D%2C%20%7B%22body%22%3A%20%22We%20don%27t%20need%20to%20differentiate%20between%20these%20two%20in%20the%20db.%20Just%20during%20the%20execution%20of%20the%20call%2C%20right%3F%22%2C%20%22created_at%22%3A%20%222014-11-24T10%3A00%3A45Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%2C%20%7B%22body%22%3A%20%22i%20would%20differentiate%2C%20because%20you%20could%20send%20both%20at%20the%20same%20time%2C%20right%3F%22%2C%20%22created_at%22%3A%20%222014-11-24T10%3A01%3A47Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/243319%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dominikkukacka%22%7D%7D%2C%20%7B%22body%22%3A%20%22actually%2C%20you%20are%20right%20%3A%29%5Cr%5Cni%20will%20rewrite%20it%20to%20an%20execution%20type%20thing%2C%20so%20one%20mongo%20object%20for%20data%2C%20and%20one%20field%20for%20execution%20type%20%28payload%2C%20formData%29%22%2C%20%22created_at%22%3A%20%222014-11-24T10%3A05%3A39Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/243319%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dominikkukacka%22%7D%7D%2C%20%7B%22body%22%3A%20%22%5Cr%5CnAwesome%21%20Thanks%21%5Cr%5Cn%5Cr%5CnSent%20from%20my%20HTC%5Cr%5Cn%5Cr%5Cn-----%20Reply%20message%20-----%5Cr%5CnFrom%3A%20%5C%22Dominik%20Kukacka%5C%22%20%3Cnotifications%40github.com%3E%5Cr%5CnTo%3A%20%5C%22EnoF/con-rest%5C%22%20%3Ccon-rest%40noreply.github.com%3E%5Cr%5CnCc%3A%20%5C%22Andy%20Tang%5C%22%20%3Candyt%40live.nl%3E%5Cr%5CnSubject%3A%20%5Bcon-rest%5D%20added%20payload%20to%20execution%20%28%2317%29%5Cr%5CnDate%3A%20Mon%2C%20Nov%2024%2C%202014%2011%3A05%5Cr%5Cn%5Cr%5Cn%5Cr%5Cnactually%2C%20you%20are%20right%20%3A%29%5Cr%5Cni%20will%20rewrite%20it%20to%20an%20execution%20type%20thing%2C%20so%20one%20mongo%20object%20for%20data%2C%20and%20one%20field%20for%20execution%20type%20%28payload%2C%20formData%29%5Cr%5Cn%5Cr%5Cn---%5Cr%5CnReply%20to%20this%20email%20directly%20or%20view%20it%20on%20GitHub%3A%5Cr%5Cnhttps%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64172592%22%2C%20%22created_at%22%3A%20%222014-11-24T10%3A06%3A36Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3Ashipit%3A%3Agun%3A%22%2C%20%22created_at%22%3A%20%222014-11-27T06%3A09%3A08Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%2C%20%7B%22body%22%3A%20%22i%20just%20completed%20the%20feature%2C%20it%20now%20takes%20two%20additional%20fields%3A%5Cr%5Cn%20%20%2A%20type%20%28can%20be%20formData%20or%20payload%29%5Cr%5Cn%20%20%2A%20data%20%28can%20contain%20either%20a%20json%20object%20%5Bpayload/formData%5D%20or%20a%20string%20%5Bpayload%5D%29%22%2C%20%22created_at%22%3A%20%222014-12-01T09%3A03%3A02Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/243319%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/dominikkukacka%22%7D%7D%2C%20%7B%22body%22%3A%20%22dude%2C%20this%20is%20awesome%20%3A%2B1%3A%20%22%2C%20%22created_at%22%3A%20%222014-12-01T11%3A08%3A09Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%2C%20%7B%22body%22%3A%20%22Other%20than%20that%2C%20I%20think%20we%20can%20merge%20this%20after%20a%20rebase%20%3A%2B1%3A%20I%27ll%20do%20the%20merge%20%22%2C%20%22created_at%22%3A%20%222014-12-01T13%3A02%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%20799c35bc9d37922d83bc4844dc1d59287856fded%20server/api.js%2028%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/EnoF/con-rest/pull/17%23discussion_r21086882%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22could%20we%20extract%20these%20to%20a%20constants%3F%20And%20also%20I%27d%20suggest%20the%20string%20to%20be%20all%20uppercase%20to%20make%20more%20clear%20that%20this%20is%20actually%20a%20constants%20%3A%29%22%2C%20%22created_at%22%3A%20%222014-12-01T13%3A00%3A46Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars.githubusercontent.com/u/1508400%3Fv%3D3%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/EnoF%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20server/api.js%3AL106-135%22%7D%7D%2C%20%22processed%22%3A%20%5B%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64163959%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64164124%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64172084%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64172198%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64172592%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64172697%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-64749867%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-65036245%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-65050030%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23discussion_r21086882%22%2C%20%22https%3A//github.com/EnoF/con-rest/pull/17%23issuecomment-65061447%22%5D%7D'></a>
<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>

<img src='http://www.codereviewhub.com/site/github-approved-avatar.png'><a href='https://github.com/TheBay0r'><img src='https://avatars.githubusercontent.com/u/8627051?v=3' width=34 height=34></a>

- [ ] <a href='#crh-comment-Pull 799c35bc9d37922d83bc4844dc1d59287856fded server/api.js 28'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/EnoF/con-rest/pull/17#discussion_r21086882'>File: server/api.js:L106-135</a></b>
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> could we extract these to a constants? And also I'd suggest the string to be all uppercase to make more clear that this is actually a constants :)
- [x] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/EnoF/con-rest/pull/17#issuecomment-64163959'>General Comment</a></b>
- <a href='https://github.com/TheBay0r'><img border=0 src='https://avatars.githubusercontent.com/u/8627051?v=3' height=16 width=16'></a> :shipit:
- <a href='https://github.com/TheBay0r'><img border=0 src='https://avatars.githubusercontent.com/u/8627051?v=3' height=16 width=16'></a> We really need some documentation how proper API calls / workflows should look like with all possible parameters etc.
But the executions itself looks nice so far
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> We don't need to differentiate between these two in the db. Just during the execution of the call, right?
- <a href='https://github.com/dominikkukacka'><img border=0 src='https://avatars.githubusercontent.com/u/243319?v=3' height=16 width=16'></a> i would differentiate, because you could send both at the same time, right?
- <a href='https://github.com/dominikkukacka'><img border=0 src='https://avatars.githubusercontent.com/u/243319?v=3' height=16 width=16'></a> actually, you are right :)
i will rewrite it to an execution type thing, so one mongo object for data, and one field for execution type (payload, formData)
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> Awesome! Thanks!
Sent from my HTC
----- Reply message -----
From: "Dominik Kukacka" <notifications@github.com>
To: "EnoF/con-rest" <con-rest@noreply.github.com>
Cc: "Andy Tang" <andyt@live.nl>
Subject: [con-rest] added payload to execution (#17)
Date: Mon, Nov 24, 2014 11:05
actually, you are right :)
i will rewrite it to an execution type thing, so one mongo object for data, and one field for execution type (payload, formData)
---
Reply to this email directly or view it on GitHub:
https://github.com/EnoF/con-rest/pull/17#issuecomment-64172592
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> :shipit::gun:
- <a href='https://github.com/dominikkukacka'><img border=0 src='https://avatars.githubusercontent.com/u/243319?v=3' height=16 width=16'></a> i just completed the feature, it now takes two additional fields:
* type (can be formData or payload)
* data (can contain either a json object [payload/formData] or a string [payload])
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> dude, this is awesome :+1:
- <a href='https://github.com/EnoF'><img border=0 src='https://avatars.githubusercontent.com/u/1508400?v=3' height=16 width=16'></a> Other than that, I think we can merge this after a rebase :+1: I'll do the merge


<a href='https://www.codereviewhub.com/EnoF/con-rest/pull/17?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/EnoF/con-rest/pull/17?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/EnoF/con-rest/pull/17?approve=0'><img src='http://www.codereviewhub.com/site/github-undo-approve.png' height=26></a>&nbsp;<a href='https://github.com/EnoF/con-rest/pull/17'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>
<a href='#crh-end'></a>