Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6179287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:37:56+00:00 2026-05-24T00:37:56+00:00

Im new to REST and am developing a client to post data to a

  • 0

Im new to REST and am developing a client to post data to a external hosted service. Im using org.reslet.resource.ClientResource to create a client

    Representation rep = new JsonRepresentation(json);
    rep.setMediaType(MediaType.APPLICATION_JSON);
    rep.setCharacterSet(CharacterSet.UTF_8);

    ClientResource clientResource = getClientResource();
    Representation reply = clientResource.post(rep);
    return readResponseStream(reply, clientResource);

however I get the following error

Exception in thread "main" Length Required (411) - Length Required
at org.restlet.resource.ClientResource.handle(ClientResource.java:858)
at org.restlet.resource.ClientResource.post(ClientResource.java:1197)
at org.mine.client.impl.RestClient.post(RestClient.java:59)

The same code works for a get request

Representation reply = clientResource.get();

I’m using reslet api 2.0.8. This seems like the problem in post org.restlet: Posting JSON content against webservice returns HTTP error 411 (length required)

I have the following jars in the classpath

org.apache.commons.codec.jar org.apache.commons.logging.jar org.apache.httpclient.jar org.apache.httpcore.jar org.json.jar org.restlet.ext.json.jar org.restlet.jar

Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:37:57+00:00Added an answer on May 24, 2026 at 12:37 am

    the problem is that GAE doesn’t support HTTP chunked encoding, therefore serialized object can’t be sent (via POST or PUT) to a GAE server.
    In Restlet Framework version 2.1 M4 we have a workaround available that buffers the HTTP entity to prevent chunk encoding. To use it, call the ClientResource#setRequestEntityBuffering(boolean) method with a “true” value. Note that this workaround isn’t required for the GWT edition.

    As you are using Restlet 2.0.8, I suggest you use the workaround published here : http://restlet.tigris.org/issues/show_bug.cgi?id=1219

    Best regards,
    Thierry Boileau

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going to be developing a REST-ful Web Service for a new public website.
I am developing a REST API using MVC2. When handling a POST request in
I am developing the REST enabled WCF Service. I am using the following code
am new to Json so a little green. I have a Rest Based Service
I started developing a Facebook app using the new Graph API. I want to
I am creating a new REST service. What is the standard for passing parameters
I'm using .NET 3.5 and WCF for developing a server-client application. Binding=BasicHttp. I'm working
i'm developing test for REST using shoulda and factory_girl. Code below context on :delete
I've been implementing a GWT application that calls a REST-service (which we're also developing).
I'm developing a simple WPF UI for image post-processing. I'd like to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.