p-v-o-s / open-log

open source online data logging
0 stars 0 forks source link

Allow for multiple fields and values in `views.data` function #5

Open cversek opened 11 years ago

cversek commented 11 years ago

We need to parse url parameters for a request like

    open-log/senddata?feedID=4&secretKey=xxxxxx&field1=temp1&val1=25.0&field2=temp2&val2=23.0&field3=humid&val3=75.0

matching the regex pattern "field[1-9][0-9]" and load the corresponding "val[1-9][0-9]". We will no doubt have to deal with the cases where the query is malformed, such as not having a "val" parameter matching a corresponding "field" tag or vice-versa.

dwblair commented 11 years ago

Giggle -- that process was fun to watch :)

Yes, this makes good sense. And I believe there are yet better ways of sending data that don't require forming the long URL. I need to read up on PUT vs POST and all that. So far, the articles I've found seem to be saying that everyone's getting it all wrong, and then the explanations of the 'right way' to do it seem completely cryptic to me. Anyway, your suggestion seems like a straightforward approach ...