Skip to content

How to set Content-Length header #395

Closed
@vijayrajah

Description

@vijayrajah

I'm trying to call an API, that expects 'Content-Length' = 0 for a HTTP PATCH Request. There is no request body for this request.

It seems golang (from 1.8) does not allow to set Content-length with zero bytes. ( pls see -- golang/go#20257)

How do I set the header?
I have tried

restyClient.SetBody(http.NoBody).SetContentLength(true)

And

reqHeader := map[string]string {
		"Content-Length": "0",
}

None of these 2 ways set the content-length header.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions