JuliaComputing/OpenAPI.jl

Only set header Content-Type for "PUT" and "POST"

Closed this issue · 0 comments

For now, all HTTP methods will be set content-type, for example:

function _oacinternal_get_model(_api::KaggleApi, owner_slug::String, model_slug::String; _mediaType=nothing)
    _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_get_model_KaggleApi, "/models/{ownerSlug}/{modelSlug}/get", ["basicAuth", ])
    OpenAPI.Clients.set_param(_ctx.path, "ownerSlug", owner_slug)  # type String
    OpenAPI.Clients.set_param(_ctx.path, "modelSlug", model_slug)  # type String
    OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
    OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
    return _ctx
end

This is out of RFC .
Although it works well, I think it better be removed to reduce network traffic.