Coder Social home page Coder Social logo

Comments (6)

vrcca avatar vrcca commented on August 18, 2024 2

Checking the API.json for this, their shape doesn't include a body type, but only querystring types. Maybe the generator could check this instead? 🤔

from aws-elixir.

philss avatar philss commented on August 18, 2024 2

I fixed the problem by setting an empty body for GET requests. According to the HTTP specs we shouldn't have a body in case of a GET or HEAD or OPTIONS requests, so I think this is safe. This fix was released in v0.9.1. Thank you all!

from aws-elixir.

philss avatar philss commented on August 18, 2024

Hi @pranavraja 👋

Perhaps we shouldn't encode when the input is nil. Or maybe GET requests shouldn't be encode. I'm not sure :/
I will take a look later this week, but if you don't mind to confirm that and open the PR, it would be awesome! :D

from aws-elixir.

pranavraja avatar pranavraja commented on August 18, 2024

Yeah not sure which option would be cleaner, in any case I checked the repo and all uses of :get pass in nil as the input anyway, whereas other http verbs do pass in an input, so it seems either way would fix the issue. Do you have a preference?

from aws-elixir.

philss avatar philss commented on August 18, 2024

@pranavraja sorry for the delay. I think we can go with not encoding GET requests. WDYT?

from aws-elixir.

philipgiuliani avatar philipgiuliani commented on August 18, 2024

We have the same issue for describe_input, describe_channel . In the meanwhile we resolved it with the following code:

defmodule OurApp.AWS.MediaLive do
  def describe_channel(client, id) do
    request(client, "/prod/channels/#{AWS.Util.encode_uri(id)}")
  end

  def describe_input(client, id) do
    request(client, "/prod/inputs/#{AWS.Util.encode_uri(id)}")
  end

  defp request(client, url) do
    AWS.Request.request_rest(
      client,
      AWS.MediaLive.metadata(),
      :get,
      url,
      [],
      [],
      %{"Body" => ""},
      [send_body_as_binary?: true],
      200
    )
  end
end

from aws-elixir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.