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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:30:50+00:00 2026-06-16T18:30:50+00:00

When using the following jquery call I receive a http 405 method not allowed

  • 0

When using the following jquery call I receive a http 405 method not allowed error message.
Does anybody know how to solve this? Is it due to the https? I tried it also with type GET and PUT with the same result

  function make_base_auth(user, password) {
        var tok = user + ':' + password;
        var hash = btoa(tok);
        return "Basic " + hash;
    }   
function createJiraIssue() {

        var datos = {
            "fields": {
                "project":
              {
                  "key": "HELP"
             },
                "summary": "Test Ticket",
                "description": "Creating of an issue using project keys and issue type  names using the REST API",
                "issuetype": {
                    "name": "Bug"
                },
                "assignee": { "name": "sim" }
            }
        };

        var parameters = JSON.stringify(datos);
        var req = $.ajax({
            url: 'https://xxx.jira.com/rest/api/2/issue/',
            type: "POST",
            data: parameters,
            contentType: 'application/jsonp',
            dataType: 'jsonp',
            async: false,
            processData: false,
            beforeSend: function (xhr) {
            xhr.setRequestHeader('Authorization', make_base_auth(user, password));
            },
            error: function (errmsg) {
                alert('error ocured:' + errmsg.responseText);
            },
            success: function (text) {
                alert(text);
            },

        });
    }

EDIT
It has to be,
contentType: ‘application/json’,
dataType: ‘json’
and the 405 error disapears.

But now the code ends up in the error callback. I changed the alert function in there to alert(‘error ocured:’ + errmsg.error);
and it gave me this:
error ocured:

function (){
if(!e){
  var c=arguments,g,h,i,j,k;b&&(k=b,b=0);
  for(g=0,h=c.length;
        g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);
        k&&f.resolveWith(k[0],k[1])
 }return this
}

In chrome I get the error in the console:
XMLHttpRequest cannot load https://xxx.jira.com/rest/api/2/issue/. Origin http://localhost:49592 is not allowed by Access-Control-Allow-Origin.
Does anybody know what the error is?

  • 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-16T18:30:51+00:00Added an answer on June 16, 2026 at 6:30 pm

    I’m not sure if it’s possible. The error you got is saying that you can’t do cross domain XMLHttp Request. you can find more information on this answer.

    One way to go around it, is to create a local API, using php (or any other language), that will serve the ajax calls made by jQuery.

    For example, write a PHP page that will create issues via the REST API, then use the javascript to post to this page all the needed details.

    Let me know if you need any help.

    EDIT

    to do it using C#, The easiest way ill probably be using something like JiraRestClient.NET.

    If you prefer to code it yourself, here is some info about connecting to Jira using REST.

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

Sidebar

Related Questions

I know that I can call a page method with jquery using the following
I am using following plugin http://pinesframework.org/pnotify/ I am creating dialog using following jquery code..
I am using the following jQuery plug-in, i.e: http://flowplayer.org/tools/scrollable.html The issue I am having
Problem Description I receive an non-descriptive "error" message whenever attempting to call an HTML
I'm using the following straight-forward jQuery implementation var soapMessage = '<soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/>\ <soap:Body xmlns:ns1=http://site.com/>\
Using the following JQuery/AJAX function I'm calling a partial view when an option is
I'm currently using the following jQuery plugin: jQuery OEmbed. This plugin works great in
I'm using the following jQuery plugins (along with the jQuery plugin): <script type=text/javascript src=scripts/jquery.scrollTo-min.js></script>
I'm using the following JQUERY Autocomplete plug-in: jQuery Plugin: Tokenizing Autocomplete Text Entry What'd
I've been using the following jquery template as a step by step form for

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.