Skip to content

Commit c248411

Browse files
committed
use Downloads.jl instead of HTTP.jl
Use Downloads.jl instead of HTTP.jl, depends on corresponding change in Swagger.jl (JuliaComputing/Swagger.jl#43)
1 parent b4f0353 commit c248411

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ authors = ["Tanmay Mohapatra <[email protected]>"]
44
keywords = ["kubernetes", "client"]
55
license = "MIT"
66
desc = "Julia Kubernetes Client"
7-
version = "0.4.3"
7+
version = "0.5.0"
88

99
[deps]
1010
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
11-
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
11+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1212
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1313
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1414
Swagger = "2d69052b-6a58-5cd9-a030-a48559c324ac"
1515
Retry = "20febd7b-183b-5ae2-ac4a-720e7ce64774"
1616

1717
[compat]
18-
HTTP = "0.8, 0.9"
19-
Swagger = "0.2"
18+
Downloads = "1"
19+
Swagger = "0.3"
2020
JSON = "0.21"
2121
Retry = "0.4"
2222
julia = "1"

src/Kuber.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module Kuber
22

33
using JSON
44
using Swagger
5-
using HTTP
6-
using Retry, HTTP.IOExtras
5+
using Downloads
6+
using Retry
77

88
include("api/Kubernetes.jl")
99
using .Kubernetes

src/api/Kubernetes.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module Kubernetes
55

66
using Random
77
using Dates
8-
using HTTP
98
using Swagger
109
import Swagger: field_name, property_type, hasproperty, validate_property, SwaggerApi, SwaggerModel
1110
import Base: convert, propertynames

src/helpers.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ end
5151
kuber_type(ctx::KuberContext, d) = kuber_type(ctx, Any, d)
5252
kuber_type(ctx::KuberContext, T, data::String) = kuber_type(ctx, T, JSON.parse(data))
5353

54-
function kuber_type(ctx::KuberContext, T, resp::HTTP.Response)
55-
ctype = HTTP.header(resp, "Content-Type", "application/json")
54+
function header(resp::Downloads.Response, name::AbstractString, defaultval::AbstractString)
55+
for (n,v) in resp.headers
56+
(n == name) && (return v)
57+
end
58+
return defaultval
59+
end
60+
61+
function kuber_type(ctx::KuberContext, T, resp::Downloads.Response)
62+
ctype = header(resp, "Content-Type", "application/json")
5663
!is_json_mime(ctype) && return T
5764
kuber_type(ctx, T, String(copy(resp.body)))
5865
end

0 commit comments

Comments
 (0)