Skip to content
This repository has been 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

Open
stijn22 opened this issue Jun 6, 2016 · 1 comment

Comments

@stijn22
Copy link

stijn22 commented Jun 6, 2016

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.

@stijn22
Copy link
Author

stijn22 commented Jun 6, 2016

Fixed it by adding the length tag to the content object instead of the header object in the method above. This is still an issue however.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant