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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:46:30+00:00 2026-06-10T06:46:30+00:00

I want to use jQuery’s ajax call with type ‘GET’ against my RESTful API

  • 0

I want to use jQuery’s ajax call with type ‘GET’ against my RESTful API running on Flask. In my request I want to post some data as JSON.

I’m doing the exact same thing for POST requests and they work like charm. But with GET Flask gives me 400 errors and looking deeper into it it seems that the JSON gets partly URIEncoded on the way ({%22email%22:%22some@email.com%22}).

I’ve tried to use decodeURIComponent as I’m JSON.stringifying the json in the ajax data parameter but makes no difference.

sessiontoken = "123abc";
jsonData = {"email": email};

$.ajax({
    type: 'GET',
    crossDomain: true,
    url: 'http://someserver/sessions/' + sessiontoken,
    dataType: 'json',
    processData: false, //added this to see if it helps, it didn't 
    contentType: "application/json",
    async: false,
    data: JSON.stringify(jsonData),
    success: function(data){
        //I'd be happy
    },
    error: function(data){
        //This is where I get as my backend throws a 400 on me due to the screwed up json
    }
});

It’s driving me nuts as I can’t seem to find anyone on the planet who’s had the same issue. I’ve been ajaxing requests before and never faced this silly thing in the past.

Edit: Ok it seems like I need to give up on my goal and just pass whatever parameters as query string instead of trying to add them to the request body. I guess there is nothing wrong with that as discussed for example here: REST API Best practices: Where to put parameters?

  • 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-10T06:46:31+00:00Added an answer on June 10, 2026 at 6:46 am

    If you trying to set any data to GET request of ajax, it will be converted to parameters of URL string. Ofcourse any symbols like ” will be represented as %URL_CODE (see all codes), and you will get query like next:

    http://someserver/sessions/sessiontoken?{%22email%22:%22some@email.com%22}
    

    Best way to organize your restful service is descript queries in URI parts. Another way you could put json into URL parameters, and parse url codes for symbols on server-side.

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

Sidebar

Related Questions

I want to use jQuery's .get method to send an ajax call to the
I want to use jQuery to make a call to a c# web service
I want to use jquery to create a request to a controller action posting
I want to use jQuery to get the checked radio button out of a
I want to use jQuery to GET a URL and explicitly check if it
<tr> <td>#</td> <td>2009</td> <td><a class=delete_this>Click</a></td> </tr> I want to use jquery and get the
I want to use jQuery to make a simple call to my MVC controller.
I want use JQuery mobile for the front-end of my mobile application, but I
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery
I want to use jquery autocomplete in a foreach loop. When using ids, only

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.