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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:04:00+00:00 2026-06-07T16:04:00+00:00

I use a simple jQuery.ajax method: $.ajax({ type: GET, url: serviceUrl + ‘/GetAgentsGroupNameById’, contentType:

  • 0

I use a simple jQuery.ajax method:

    $.ajax({
        type: "GET",
        url: serviceUrl + '/GetAgentsGroupNameById',
        contentType: "application/json; charset=utf-8",
        data: { id: agentsGroupId },
        async: false,
        success: function (data) {
            agentsGroupName = data["d"];
        },
        error: function (request, message) {
            agentsGroupName = '';
        }
    });

The ‘Get’ request is sent and I get a well-formed json response from the server.
The problem is that I see in the developer tools that another request is generated to the same URL, with request method: OPTIONS, with an empty response, and I see an error:

OPTIONS http://localhost:1004/MobileService.asmx/GetSubscribedAgentsByUserId?userId=27 500 (Internal Server Error) 

What is this OPTIONS request?
Why does it happen?

P.S. I mentioned that if I delete contentType: “application/json; charset=utf-8” (and add dataType: json or jsonp), no OPTIONS request is generated, but I don’t get a well-formed json as a response (I get kinda xml document)

BTW: the service is asp.net c#:

[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public string GetAgentsGroupNameById(int id)

PLEASE LET ME KNOW IF YOU NEED ANY FURTHER DETAILS ABOUT THE REQUEST OR THE RESPONSE

Thanks from advance!!!

  • 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-07T16:04:01+00:00Added an answer on June 7, 2026 at 4:04 pm

    The OPTIONS request is because of the Cross origin resource sharing. It is basically the web browser asking the destination server whether it allows cross domain resource sharing.

    In short, you cannot make json requests to a different domain than the domain that the page is being served from.

    If you are only doing GET requests, you may want to look at JSONP which solves this issue. However, it only works with GET requests.

    There have been a lot of questions on this, and there is a details answer here

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

Sidebar

Related Questions

Currently, I'm adapting a registration page to use Ajax/jQuery. Its in the simple stage,
This is probably a simple question. I use ASP.NET ajax toolkit and Jquery. I
I'm trying to use the simple modal jquery library on a page and the
My issue here is quite simple : i'm trying to use the jQuery validate
I am attempting to use a jquery drowndown checklist control. Following some simple examples,
I use this code: http://blogswizards.com/plugin-development/sliding-boxes-and-captions-with-jquery On a simple gallery site I am building. Specifically
I'm trying to use Simple Savant within my application, to use SimpleDB I currently
I use jQuery ajax calls to ASP.Net web services (ASMX files) to update the
Im ready to start pulling my hair out here. Trying to use jquery ajax
How would I get my JSON string to my asp.net using jquery I am

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.