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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:10:44+00:00 2026-06-10T16:10:44+00:00

I have two domains: accounts.example.org app.example.org Now I want to do a HTTP DELETE

  • 0

I have two domains:

  1. accounts.example.org
  2. app.example.org

Now I want to do a HTTP DELETE request from app.example.org to accounts.example.org/session.

$.ajax({
  url: "http://accounts.example.org/session",
  type: "DELETE"
});

Nothing really different. Headers from accounts.example.org to allow CORS are:

Access-Control-Allow-Origin: http://app.example.org
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: X-Requested-With, Content-Type

So the AJAX call fails now and tells me that there is a problem with the CORS headers…
I took a closer look at the AJAX options and found that jQuery doesn’t directly do a DELETE:

Request URL:http://accounts.example.org/session
Request Method:OPTIONS
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Access-Control-Request-Headers:origin, accept
Access-Control-Request-Method:DELETE
Connection:keep-alive
Host:accounts.example.org
Origin:http://app.example.org
Referer:http://app.example.org/

Does somebody know what this can be?

Server Backend is node.js with express as framework.

Regards

UPDATE

I can now specify the issue:

The problem is that the browser does an OPTIONS request before PUT and DELETE (GET and POST work). This is done because the browser wants to check the CORS policy before doing the real request. For some reason express doesn’t handle this request (the response headers are empty). So the browser returns that the CORS policy forbids the request.

I alread tried:

  1. setting headers with app.use
  2. with app.all
  3. with app.options

No reactions. Sounds like that there could be a bug …

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

    What browser is it? I know it works in chrome atleast. This is what jQuery homepage states about PUT and delete.

    “The type of request to make (“POST” or “GET”), default is “GET”.
    Note: Other HTTP request methods, such as PUT and DELETE, can also be
    used here, but they are not supported by all browsers.”

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

Sidebar

Related Questions

I have a hotel with two domains. Now the customer want a redirect: domain1.dk/folder/
I have two domains declared in my app. class Posts { String title String
I have two domains - abc.com and xyz.com. I have a CNAME that points
I have two domains that point to the same IP, which is an Ubuntu
I'm not very good in SQL and HQL... I have two domains: class Hotel
I have two CDN domains, one that delivers content over https and the other
What's the best way to have two websites (asp.net based) running on different domains
I have a website that is mirrored cross two sub-domains. So I have separate
Let's say I have myapp.appspot.com and two custom domains respectively called foo.com and bar.com
I have code seperated in two domain. Both domains and code is trusted. I

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.