Skip to content

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

@dcsobral

Description

@dcsobral

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
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions