slight fix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/lib/ex_ovh/services/v1/webstorage/query.ex b/lib/ex_ovh/services/v1/webstorage/query.ex
index be976f6..78476cc 100644
--- a/lib/ex_ovh/services/v1/webstorage/query.ex
+++ b/lib/ex_ovh/services/v1/webstorage/query.ex
@@ -13,7 +13,7 @@ defmodule ExOvh.Services.V1.Webstorage.Query do
## Example
- ExOvh.Services.V1.Webstorage.Query. get_services() |> ExOvh.Ovh.request()
+ ExOvh.Services.V1.Webstorage.Query.get_services() |> ExOvh.Ovh.request()
"""
@spec get_services() :: Query.t
def get_services() do
@@ -53,8 +53,8 @@ defmodule ExOvh.Services.V1.Webstorage.Query do
def get_service(service_name) do
%Query{
method: :get,
- uri: "/cdn/webstorage/",
- params: service_name
+ uri: "/cdn/webstorage/#{service_name}",
+ params: %{}
}
end
@@ -117,7 +117,12 @@ defmodule ExOvh.Services.V1.Webstorage.Query do
%Query{
method: :get,
uri: "/cdn/webstorage/#{service_name}/statistics",
- params: %{"period" => period, "type" => type}
+ params: %{
+ query_string: %{
+ "period" => period,
+ "type" => type
+ }
+ }
}
end
diff --git a/lib/ex_ovh/transformation.ex b/lib/ex_ovh/transformation.ex
index e564b4b..dbe52c8 100644
--- a/lib/ex_ovh/transformation.ex
+++ b/lib/ex_ovh/transformation.ex
@@ -9,15 +9,6 @@ defmodule ExOvh.Transformation do
@spec prepare_request(Query.t, Keyword.t, atom) :: HttpQuery.t
def prepare_request(%Query{method: method, uri: uri, params: params, headers: headers}, httpoison_opts, client) do
-# uri = if params !== :nil and params !== "" and is_map(params) and method in [:get, :head, :delete], do: uri <> "?" <> URI.encode_query(params), else: uri
-# uri = if params !== :nil and params !== "" and is_map(params) === :false and method in [:get, :head, :delete], do: uri <> URI.encode_www_form(params), else: uri
-# params =
-# case params !== "" and params !== :nil and is_map(params) and method in [:put, :post] do
-# :true -> Poison.encode!(params)
-# :false -> params
-# end
-# ovh_config = client.ovh_config()
-# uri = ovh_config[:endpoint] <> ovh_config[:api_version] <> uri
ovh_config = client.ovh_config()
uri = ovh_config[:endpoint] <> ovh_config[:api_version] <> uri
uri =