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

Changes in API from Cohttp version #176

Open
roddyyaga opened this issue Jul 31, 2020 · 1 comment
Open

Changes in API from Cohttp version #176

roddyyaga opened this issue Jul 31, 2020 · 1 comment

Comments

@roddyyaga
Copy link
Contributor

In the Cohttp version, there is a respond function and body type like this:

let to_body = function
  | `String s -> Body.of_string s
  | `Empty -> Body.empty
  | `Json j -> j |> Yojson.Safe.to_string |> Body.of_string

let respond ?headers ?status body =
  Response.make ?headers ?status ~body:(to_body body) () |> Lwt.return

Personally I thought that was a nice API, is there a reason it's been removed from the latest version?

@anuragsoni
Copy link
Collaborator

anuragsoni commented Jul 31, 2020 via email

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

No branches or pull requests

2 participants