-
Notifications
You must be signed in to change notification settings - Fork 4
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
Can not be used in the client part #15
Comments
There aren’t MimeUnrender instances. blaze-markup (and lucid) are ”write-only” libraries, they don’t contain HTML parsers.
There are HTML libraries though, but I don’t know if anyone made Servant bindings for them
… On 10 Apr 2019, at 13.16, picca ***@***.***> wrote:
Hello
while working on an API, I end up with this error
/home/experiences/instrumentation/picca/autoprocess-exe/src/Web.hs:95:32: error:
• No instance for (Servant.API.ContentTypes.MimeUnrender
HTML (Text.Blaze.Internal.MarkupM ()))
arising from a use of ‘client’
• In the expression: client myApi
In a pattern binding: postJobSpecSub :<|> homepage = client myApi
|
95 | postJobSpecSub :<|> homepage = client myApi
| ^^^^^^^^^^^^
-- While building custom Setup.hs for package autoprocessing-0.1.0.0 using:
/home/experiences/instrumentation/picca/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:autoprocessing exe:autoprocessing-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
So my question is what is the proper way to use the client part in an API
Cheers
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
There aren’t MimeUnrender instances. blaze-markup (and lucid) are ”write-only” libraries, they don’t contain HTML parsers.
There are HTML libraries though, but I don’t know if anyone made Servant bindings for them
I just need the write-only part in my server part with blaze.
But I need also to create a client part for the other entry points.
So in mycase
h1 :<|> h2 = client myAPI
is it possible to avoid the h2 and use only a subset of myAPI
|
type RestApi = ...
type HtmlApi = ...
type Api = RestApi :<|> HtmlApi
h1 = client restApi |
h1 = client restApi
did you mean ?
h1 = client RestAPI
|
|
restApi = Proxy :: Proxy RestApi
thanks a lot, I will test this tomorrow :)
|
can't |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
while working on an API, I end up with this error
So my question is what is the proper way to use the client part in an API
Cheers
The text was updated successfully, but these errors were encountered: