Skip to content

Weird responses when sending more than one request to a Cowboy server #143

Description

@dabaer

I'm getting some unexpected results when firing HTTPoison request()'s within 1 second of each other. Every second request I am consistently seeing some sort of cached response, where it falls and hits one of my cases, but it doesn't ping the URL at all.

case HTTPoison.request(:post, url, file) do
    {:ok, %HTTPoison.Response{status_code: 200, body: []}} ->
        # Work
    {:ok, %HTTPoison.Response{status_code: 400, body: body}} ->
        # This clause gets hit the first time correctly based on the response from the endpoint, and it also hits it the second time, but without firing a request at the endpoint at all...
    _ ->
        # More work
end

Regards,
Dakota

P.S. I wait until the request is fully complete on both sides before hitting it again.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions