I am trying to call a rest service using ajax in SharePoint online list form by adding a web part. Here is the code attached. SharePoint is https where as my java rest service is http. I am confused how to get a response. When I debugged it says content media blocked!. Please help me with this.

                type: "POST",
        contentType: "application/json; charset=utf-8",
                async: false , dataType: "json",
        data: JSON.stringify(item),
                success: function (result) {
                error: function (xhr, textStatus, error) {

1 Answer 1


You are trying to call unsecured web service in a secured website that called a Mix Content.

Unfortunately, this doesn't work!! you will need to call a secure HTTPS web service to get it working as expected!

As a temporary workaround, try to enable Mixed Content in your browser that may work!

  • but the SharePoint list will be used by various people, they cannot every time go and change it right? The values should be populated automatically. I have a http api which needs to integrated into sharepoint list which is https. Aug 21, 2018 at 13:48
  • Totaly Agree with you, it's unpractical solution so I said it's temporary! and as a permanent solution based on my humble experience, you must use a secure HTTPS web service URL to get it work! Aug 22, 2018 at 2:30
  • 1
    Hi Mohamed I have posted a new question regarding https. Please find the link for the qyestion - sharepoint.stackexchange.com/questions/247918/… Aug 28, 2018 at 17:45
  • Sure, I will and I do hope to can help you :) Aug 28, 2018 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.