Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Request to url returned an error response 411:Length Required HTTP/1.1 411 Length Required #1768

@stijn22

Description

@stijn22

Hi,

I am trying to update files via the methods updateFile and updateCommunityFile provided by the FileSerivce. However, both methods throw the same error:

java.lang.RuntimeException: com.ibm.sbt.services.client.ClientServicesException: Request to url returned an error response 411:Length Required HTTP/1.1 411 Length Required [Server: AkamaiGHost, Mime-Version: 1.0, Content-Type: text/html, Content-Length: 221, Expires: Mon, 06 Jun 2016 09:17:32 GMT, Date: Mon, 06 Jun 2016 09:17:32 GMT, Connection: close]

I tried fixing it by adding the Content-Length myself:

final FileService service = new FileService(connection.getEndpoint()) {
@Override
public Response updateData(final String serviceUrl, final Map<String, String> parameters, final Map<String, String> headers, final Object content, final String nameParameterId) throws ClientServicesException
{
headers.put("Content-Length", length);
return super.updateData(serviceUrl, parameters, headers, content, nameParameterId);
}};

When using this, I get an error that says that Content-Length is defined twice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions