Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time.Time support for URL encoded POST requests #2

Closed
fabioberger opened this issue Jun 14, 2015 · 2 comments
Closed

Add time.Time support for URL encoded POST requests #2

fabioberger opened this issue Jun 14, 2015 · 2 comments

Comments

@fabioberger
Copy link

No description provided.

@albrow
Copy link
Contributor

albrow commented Jun 14, 2015

Thanks for the suggestion! Could see this being a common use case.

However, AFAIK there's no standard for converting time to url-encoded format. Any ideas for what format to use? Unix time? RFC3339 or some other standard from the std lib? As it stands now my advice would be to just store times in Unix format (seconds since the epoch) since everything in your stack (frontend, http layer, server, database) can deal with ints in a predictable way.

@fabioberger
Copy link
Author

Ah interesting. I ended up using JSON instead of URL-encoded and that worked well enough for my needs:

rest.SetContentType(rest.ContentJSON)
err := rest.Create(&workHours)
if err != nil {
    console.Log(err.Error())
    return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants