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 5848733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:54:03+00:00 2026-05-22T12:54:03+00:00

I’m trying to send json string in the get request to the server, here

  • 0

I’m trying to send json string in the get request to the server, here is how it looks before encoding :

filters={"groupOp":"AND","rules":[{"field":"countrycode","op":"eq","data":"ARG"}]}

Naturally I end up with null pointer when trying to get this json string, then I googled this encodeURIComponent and it partially encodes this string like this :

filters={"groupOp"%3A"AND"%2C"rules"%3A[{"field"%3A"countrycode"%2C"op"%3A"eq"%2C"data"%3A"ARG"}]}

But this is how it supposed to be in order to work :

filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22countrycode%22%2C%22op%22%3A%22eq%22%2C%22data%22%3A%22ARG%22%7D%5D%7D

How do I get this, entirely encoded string so I can read it at server side properly ?

Reason why I used get instead of post

I’m sending this filter(json) content to the server side, web service gets data from the database and returns pdf document.

Using post, I’m able to send correct data and the response is successfully displayed in my firebug console. But I need to return pdf doc to override the current page or open new window/tab and return in that one.

  • 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-22T12:54:04+00:00Added an answer on May 22, 2026 at 12:54 pm

    I think you’re overworking this problem. Or encoding too many times. Or something.
    You’ve got a JSON string, and you are trying to JSON encode it. That seems…unhelpful.

    A better approach might be to produce a Javascript object, then JSON.Stringify that, and then transmit it as a parameter.

    var thing = {
      groupOp : "AND",
      rules : [
        { field : "countrycode", op : "eq", data : "ARG" },
          ...
      ],
        ...
    }; 
    var stringrep = JSON.stringify(thing);
    // post via jQuery
    $.ajax({
      type: 'POST',
      url: url,
      data: stringrep,
      dataType: 'json'
      success: function() { ... },
    });
    

    Normally for a JSON stringified message to or from the server, you’d want to use HTTP POST. HTTP GET puts all “parameters” in the URL; there is no message body. In contrast, HTTP POST allows you to attach a message body to the HTTP message, which can be “anything”. With that approach, you don’t need to url-encode the quotes and spaces; the JSON message just gets transmitted as the message body of the HTTP message.

    HTTP POST is the way applications upload images, or transmit XML documents, and so on. Anything complex gets transmitted via POST.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.