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

HttpClient.delete fails with Malformed message body: Invalid JSON: empty body #489

Open
dcsobral opened this issue May 4, 2020 · 0 comments

Comments

@dcsobral
Copy link
Contributor

dcsobral commented May 4, 2020

As it happens, HttpClient.delete is used when no body is expected from the server (as opposed to HttpCliente.deleteWithResponse).

I'm not sure if there's anything on github4s algebras using that method. I've used to to implement a delete reference:

  def deleteReference(owner: String, repo: String, ref: String, headers: Map[String, String]): F[GHResponse[Unit]] = {
    for {
      _ <- Sync[F].delay(assert(ref.matches("refs/(heads|tags)/.+"), f"Invalid reference $ref%s"))
      res <- client.delete(accessToken, f"repos/$owner%s/$repo%s/git/$ref%s")
    } yield res
  }
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

1 participant