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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:30:35+00:00 2026-06-14T05:30:35+00:00

When I pass this request it pass null to request parameter on server site.

  • 0

When I pass this request it pass null to request parameter on server site.
Is there any wrong with data attribute?

$.getJSON('http://127.0.0.1:81/api/sites/GetDomainAvailability?apikey=asfasfdsf&callback=?', { "request": '{"SubDomain":"asfsadf","ParentDomain":"asfasdf","ResellerId":"asfdsd"}' }, function (results) {

    alert('Cross domain JS call achieved. Have your implementation going in here!');
});

API C#

[HttpGet]
public HttpResponseMessage GetDomainAvailability(GetDomainAvailabilityRequest request)
{
    if (ModelState.IsValid)
    {
        if (request == null) return Request.CreateResponse(HttpStatusCode.BadRequest, "Invalid Request");
        var domain = string.Format("{0}.{1}", request.SubDomain, request.ParentDomain);

        var manager = new CloudSitesManager();
        var isDomainAvailable = manager.GetDomainAvailability(domain);

        HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, isDomainAvailable);
        return response;
    }
    else
    {
        return Request.CreateResponse(HttpStatusCode.BadRequest);
    }
}

[Serializable]
public class GetDomainAvailabilityRequest
{
    public string SubDomain { get; set; }
    public string ParentDomain { get; set; }
    public string ResellerId { get; set; }
}
  • 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-14T05:30:36+00:00Added an answer on June 14, 2026 at 5:30 am

    It’s a problem with the model binding. Start with trying this:

    $.getJSON('http://127.0.0.1:81/api/sites/GetDomainAvailability', {SubDomain:"asfsadf",ParentDomain:"asfasdf",ResellerId:"asfdsd"}, function (results) {
    
        alert('Cross domain JS call achieved. Have your implementation going in here!');
    });
    

    if this above doesn’t work, try this. I took this from some code I have doing the exact same thing you are attempting.

    var data = { SubDomain: "asfsadf", ParentDomain: "asfasdf", ResellerId: "asfdsd" };
    
    $.post('http://127.0.0.1:81/api/sites/GetDomainAvailability', data, function (results) {
    
        alert('Cross domain JS call achieved. Have your implementation going in here!');
    }, 'json');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am sending password text to the http service request object.like <request><password>pass.text</password></request> now this
I know this is impossible to pass parameter from javascript to scriptlet code in
I'm trying to pass this associative array to JavaScript: Array ( [0] => Array
I'm trying to pass this to a PHP script through AJAX: var answers={}; for
When I pass 'this' to an anonymous function like so: MyClass.prototype.trigger = function(){ window.setTimeout(function(){this.onTimeout();},1000);
I need to pass this filepath over via route to my actionmethod: <p><a href=/Cars/@Model.CarId/@car.ContainerPath/@Model.UserId/Url>@car.Name</a></p>
If I have the value 0.0042 returned and I pass this to: string.Format({0:C},....); It
I'm generating a string of values (colors) like so: 'red|green|blue|yellow|orange|black' Can I pass this
I have the following and you can see I am trying to pass this
I have a form and what i need to do is to pass this

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.