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

  • Home
  • SEARCH
  • 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 6743775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:00:09+00:00 2026-05-26T12:00:09+00:00

I have a controller that I’m using specifically for AJAX stuff, i.e. jquery makes

  • 0

I have a controller that I’m using specifically for AJAX stuff, i.e. jquery makes a call to a particular URL and it passes back some json. However, some of the actions in this controller make use of services that we pay for and I don’t want other people to be able to call these outside of my app.

I’ve seen this question which restricts access to a controller by IP which is all well and good, but since technically this will be called client-side I can’t use this kind of restriction.

So how do I go about doing this? Or am I going about it the wrong way?

Edit: Would doing it as a POST rather than a GET be better?

Edit2: I think I need to explain more. The ajax call is to a URL in my web app. That controller is for an action which then (server-side) calls the web service from the lookup service.

  • 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-05-26T12:00:09+00:00Added an answer on May 26, 2026 at 12:00 pm

    So it sounds like you are using an external postcode lookup service (where I assume you pay-per-request) and you don’t want someone else to make postcode lookup requests by piggy-backing on your service, where you will get charged?

    The first thing you should do is check whether your service provider allows you to specify a whitelist of referrers. Since many of these apis mean your “api key” is in javascript somewhere, this is often used to only allow service requests (using your key) from a specific host or ip address.

    With this done, you’ll want to ensure that your post code lookup action is only called from pages within your site.

    You can do this with some kind of anti forgery token on the client. Phil Haack posted recently about getting this to work with AJAX posts.

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

Sidebar

Related Questions

I have a controller that makes HTTP GET requests using a custom class, which
I have a controller that is called with AJAX (sends JSON data), so I
I have a controller that is being called twice from an ActionLink call. My
I have a controller that is all ajax calls, so I want to verify
i have a controller that have with in let's say thingy/stuff directory <?php public
Using S#arp Architecture 1.0RC... I have a controller that never seems to update one
In Spring 3 MVC, I have a controller that I call SettingsController, and it
I have an controller that has actions that are set up using chained. My
I have a controller that looks like this: public ActionResult Sold() { using (WipDBEntities
I have a Controller that call HttpContext like: [Authorize(Roles = Administrador)] public class ApuradorController

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.