httppost in other than json format

29 views
Skip to first unread message

que...@cityblooms.com

unread,
Sep 30, 2014, 6:48:11 PM9/30/14
to proto...@googlegroups.com
I have a preexisting php file running on a server that pushes data into a SQL database. It is set up to take a post with the following:

header:

Content-Type: application/x-www-form-urlencoded
Connection: Keep-Alive
etc..

content:

id=1&time=1412115600&ph=11.87&ec=0.0&target_ph=20&target_ec=10&rtemp=-99.0
&target_rtemp=&target_ut=&water_full=1&water_loop=1

etc...

Can I use the httppost framework that is provided with protocoder to post "unstructured" data or must I look into rewriting the php side to handle the json formatted post?

Thanks so much,
Quentin

que...@cityblooms.com

unread,
Oct 1, 2014, 2:37:59 PM10/1/14
to proto...@googlegroups.com
I wanted to clarify my question as I learn more about this,
I now understand that the httppost example in protocoder is posting multipart/mixed form
Content-Type: multipart/form-data; boundary=6unC5fnE5vj0g2M8zhGBXFsqxV1zB-O1QOb
which allows both data and files, separated by the define boundary code
whereas I want to post

Content-Type: application/x-www-form-urlencoded

Just thought I'd clarify as I'm new to this side of things and realized that I had misspoken somewhat.

Really enjoying protocoder for how much instant gratification in prototyping I am getting.. Almost have a working proof of concept an arduino doing all the always on, low level control, the android tablet taking the serial data and parsing it, pushing it to server, providing a nice UI screen for calibration, set points, etc.. Pretty cool.

Thanks again,
Quentin

Víctor Díaz

unread,
Oct 3, 2014, 8:34:45 AM10/3/14
to proto...@googlegroups.com
Hello Quentin! 

1) Did you manage to solve the post request? Yes the example post multipart/mixed.
Is there a way I can try an example? Do you mind sharing a little .php bits + some Protocoder code and I try to replicate it? 

I'd love to add more flexibility to the post request :)


2) Glad that you like Protocoder! Keep an eye on the upcoming versions because its going to change a lot! (for the better) :)

Cheers!

Victor
Reply all
Reply to author
Forward
0 new messages