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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:41:59+00:00 2026-06-15T09:41:59+00:00

I am having some trouble fetching a collection. I’m using the console’s network inspector

  • 0

I am having some trouble fetching a collection. I’m using the console’s network inspector to see if I can figure out what’s wrong and the only thing I see is the format of the Request Payload.

When making a .fetch() the Request Payload is being sent in this format:

query=this+is+my+query

This returns a 400 Bad Request status from my server. I have tested using:

$.ajax({
contentType: 'application/json',
async : false,
type:'POST',
url: '/search',
data: JSON.stringify({"query":"this is my query"}),
dataType: 'json',
success: function(data) {
    alert('yup');
},
error: function(data) {
    alert('nope');
}});

which returns my data as expected. In this case the Request Payload is in this format:

{"query":"enterprise search is gonna rock","scope":null}

I’ve tried passing in headers with my fetch:

my_results.fetch({data:{"query":"this is my query"}, type: 'POST', dataType: 'json', contentType: 'application/json'});

Here is what my Model and Collection look like:

EnterpriseSearch.Result = Backbone.Model.extend(); 
EnterpriseSearch.Results = Backbone.Collection.extend({     
  model: EnterpriseSearch.Result,
  url: "/search"
});

Any help would be 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-06-15T09:42:00+00:00Added an answer on June 15, 2026 at 9:42 am

    Try using data: JSON.stringify({"query":"this is my query"}) in your fetch options, just like you do when using $.ajax. jQuery will default to application/x-www-form-urlencoded for form data.

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

Sidebar

Related Questions

Im having some trouble with Jquery Templates and can't seem to figure out what's
having some trouble trying to figure this out, complete novice when it come to
Having some trouble with R's garbage collection, when passing objects to C++. We have
Am having some trouble with the SkyDrive download process and hoping you can help
Basically having some trouble with using Hover to hide or show an item. The
I´m having some trouble retrieving a collection of strings in a projection: say that
Im having some trouble with an Array in C++. See I want to let
Having some trouble using basic authentication with a simple test Wcf service. I am
Having some trouble figuring out why my ImageView buttons stop working after I change
Having some trouble figuring this one out. If both the checkbox in the second

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.