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 support for application/x-www-form-urlencoded #13

Merged
merged 2 commits into from
Feb 23, 2015
Merged

Add support for application/x-www-form-urlencoded #13

merged 2 commits into from
Feb 23, 2015

Conversation

tvh
Copy link
Contributor

@tvh tvh commented Feb 20, 2015

This depends on #9. It support for url encoded request bodys. To use a custom type, There is these typeclasses:

class ToFormUrlEncoded a where
  toFormUrlEncoded :: a -> [(TextL.Text, TextL.Text)]

class FromFormUrlEncoded a where
  fromFormUrlEncoded :: [(TextL.Text, TextL.Text)] -> Either String a

@coveralls
Copy link

Coverage Status

Coverage decreased (-4.99%) to 53.59% when pulling bda1c30 on anchor:form-urlencoded into fb71eb8 on haskell-servant:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+30.3%) to 88.89% when pulling 937e7c2 on anchor:form-urlencoded into fb71eb8 on haskell-servant:master.

@christian-marie
Copy link
Contributor

I'm going to wait till the dependent PR is merged to review

@alpmestan
Copy link
Contributor

Looks good, once #9 is merged in. We'll just have to rebase this PR to make sure travis gives us the go-ahead. Cheers!

@jkarni
Copy link
Member

jkarni commented Feb 20, 2015

Good stuff. Mind adding a few more tests? Since the encoding/decoding is in-house, just checking inverse laws doesn't quite seem like enough.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6ef48cf on anchor:form-urlencoded into * on haskell-servant:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1d378e6 on anchor:form-urlencoded into * on haskell-servant:master*.

@tvh
Copy link
Contributor Author

tvh commented Feb 23, 2015

I just added 2 more roundtrip-tests using a different library..

The reason I don't use that library in the first place is

  1. Avoid lots of string-conversions
  2. Avoid extra import for very simple functionality

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4f91a28 on anchor:form-urlencoded into * on haskell-servant:master*.

jkarni added a commit that referenced this pull request Feb 23, 2015
Add support for application/x-www-form-urlencoded
@jkarni jkarni merged commit 465e006 into haskell-servant:master Feb 23, 2015
@jkarni
Copy link
Member

jkarni commented Feb 23, 2015

Thanks!

jkarni added a commit that referenced this pull request Apr 20, 2015
jkarni added a commit that referenced this pull request Apr 20, 2015
Use an `IORef` rather than a `MVar`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants