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

  • Home
  • SEARCH
  • 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 8754675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:40:49+00:00 2026-06-13T13:40:49+00:00

I am trying to send JSON object as parameter. localhost:8080/HelloWorldApplication/webresources/helloworld/get/{param} During this process I

  • 0

I am trying to send JSON object as parameter.

localhost:8080/HelloWorldApplication/webresources/helloworld/get/{param}

During this process I am sending a big JSON object, similar to :

{"follow_request_sent": false, "profile_use_background_image": true, "contributors_enabled": false, "id": 200, "verified": false, "profile_image_url_https": "https://si0.twimg.com/sticky/default_profile_images/default_profile_4_normal.png", "profile_sidebar_fill_color": "e0ff92", "is_translator": false, "profile_text_color": "000000", "followers_count": 869, "profile_sidebar_border_color": "87bc44", "id_str": "200", "default_profile_image": true, "listed_count": 0, "status": {"favorited": false, "contributors": null, "truncated": false, "text": "http://goo.gl/OkfpC", "created_at": "2010-12-07T05:58:01", "retweeted": false, "in_reply_to_status_id": null, "coordinates": null, "source_url": "http://mobile.twitter.com", "source": "Mobile Web", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "in_reply_to_user_id": null, "id": 12023002585628672, "place": null, "retweet_count": 0, "geo": null, "in_reply_to_user_id_str": null, "possibly_sensitive": false, "id_str": "12023002585628672"}, "utc_offset": -28800, "statuses_count": 6, "description": "", "friends_count": 4, "location": "", "profile_link_color": "0000ff", "profile_image_url": "http://a0.twimg.com/sticky/default_profile_images/default_profile_4_normal.png", "notifications": false, "show_all_inline_media": false, "geo_enabled": true, "profile_background_color": "9ae4e8", "profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png", "name": "Dalbir Singh", "lang": "en", "profile_background_tile": false, "favourites_count": 0, "screen_name": "dalbirsingh", "url": null, "created_at": "2006-04-29T01:00:27", "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png", "time_zone": "Pacific Time (US & Canada)", "protected": false, "default_profile": false, "following": false}

my code works well until few number of parameters but not with as large object as mentioned above .
Is there any limit to the length of JSONobject or other parameter to be sent over http request , If yes, then how to modify it.

Code:

@GET 
    @Path("/get/{empno}")// this method process GET request from client
    @Produces("application/json")   // sends JSON
    public String getJson(@PathParam("empno") JSONObject p) {  // empno represents the empno sent from client   
        JSONObject obj = p;
        String x = obj.toString();
        System.out.println(x);
        //some function
        return "x";

   }
  • 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-06-13T13:40:50+00:00Added an answer on June 13, 2026 at 1:40 pm

    Yes there is a limit to urls length. It is however dependent on the browser and the web server (it is usually configurable, but I think it is a bad idea to change it…).

    Usually if your url is less than 2000 characters it should always work. You can also have a look at this thread What is the maximum length of a URL in different browsers?
    And some other links maximum length of HTTP GET request?, http://www.boutell.com/newfaq/misc/urllength.html.

    Anyway what you are doing is a bad practice. You should not pass json in the url, json should be used as the body of post requests. Having json as request parameter is not really REST style, there are discussions if url parameters is ok for REST apis, but it is discutable…

    EDIT
    An example for jersey with post and using a library having databinding support:

    Download genson library http://code.google.com/p/genson/, when it is in your classpath json databinding will be automatically enabled for jersey.
    Define classes corresponding to the json input (I called it ARequestBean) and AResponseBean containing the response that will be serialized to json.

    @POST 
    @Path("/post")
    @Consumes(("application/json") // consumes JSON
    @Produces("application/json")   // sends JSON
    public AResponseBean getJson(ARequestBean request) {
      return ...;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send a json object using GET method. My code: $.ajax({
I'm trying to send JSON-object form MongoDB to page with ejs template engine. Here's
I am trying to use jQuery ajax to send a json object to a
I am trying to send a serialized object using JSON. Here is my view
I am trying to send JSON data from a form using the XMLHttpRequest object.
I am trying to get the JSON object which will contain tweets of a
I'm trying to send json object to server. But I received an error and
I'm trying to send a JSON object from an AJAX request to my server.
Happy coding weekend to everyone!!!. I'm stuck trying to send a JSON object via
I am trying to get send json from my javascript (using jquery post) to

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.