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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:34:53+00:00 2026-06-16T02:34:53+00:00

I am sending a collection of GUID-like objects to my MVC controller like so:

  • 0

I am sending a collection of GUID-like objects to my MVC controller like so:

$.ajax({
    type: 'GET',
    url: 'http://localhost:61975/Song/GetByIds',
    dataType: 'json',
    contentType: 'application/json; charset=utf-8',
    data: {
        songIds: JSON.stringify(songIds)
    },
    success: function (data) {
    },
    error: function(error) {
        console.error(error);
    }
});

The data being sent in my request header looks like:

songIds:[“6cb44f55-9fd5-4540-9b11-75ccce816d67”]

and my MVC3 controller method looks like:

[HttpGet]
public ActionResult GetByIds(List<Guid> songIds)
{
    SongManager songManager = new SongManager(SongDao, PlaylistDao, PlaylistItemDao);
    IList<Song> songs = songManager.GetByIds(songIds);
    return new JsonDataContractActionResult(songs);
}

In this implementation I receive a non-null List object, but it is always empty. What’s my mistake?

EDIT: If I POST like this instead of GET it works fine. How come??

$.ajax({
    type: 'POST',
    url: 'http://localhost:61975/Song/GetByIds',
    dataType: 'json',
    contentType: 'application/json; charset=utf-8',
    data: JSON.stringify({
        songIds: songIds
    }),
    success: function (data) {
        loadedSongs = loadedSongs;
        if (callback) {
            callback(data);
        }
    },
    error: function(error) {
        console.error(error);
    }
});
  • 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-16T02:34:55+00:00Added an answer on June 16, 2026 at 2:34 am

    You should try to use “traditional” option set to true for your jQuery Ajax request.

    Refer to documentation for more details : http://api.jquery.com/jQuery.ajax/

    And you should also remove the JSON.Stringify part.

    Can you try this out and let me know if it worked out for you ?
    I Did a test on my end and it works just fine.

    $.ajax({
        type: 'GET',
        url: 'http://localhost:61975/Song/GetByIds',
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        traditional: true, //// traditional option to true
        data: {
           songIds: songIds  /// no JSON.stringify
        },
        success: function (data) {
        },
        error: function(error) {
          console.error(error);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I sending ajax request from a jQuery file like below, which expects response in
When sending data via POST or GET with jQuery you use for format {
I have a rails app that is responding to requests at the url '/copy/:collection/:email'.
I'm sending a JSON collection from Javascript through a REST web service to be
I have a POJO which declares a collection of List<Long> . We're currently sending
I have a button which is sending a get request over XHR to a
I am sending Graphite the time spent in Garbage Collection (getting this from jvm
Is it possible to pass a collection of objects to a RIA Data Service
I am POSTing data to an MVC controller and I'm attempting to maintain state
I have a situation where I am sending data to a Controller via jQuery

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.