• Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    Ajax net::ERR_SPDY_PROTOCOL_ERROR

    Opera for Windows
    2
    4
    1921
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gydrus
      gydrus last edited by

      Hello!
      I've moved my site to new server (ubuntu 16.04 + nginx + php7.2) and got errors "POST https://food-tracker.ru/foods net::ERR_SPDY_PROTOCOL_ERROR" when it make ajax requests.
      There are no errors at FireFox and Internet Explorer browsers! And at previous server with debian7+nginx+php5 all worked fine with latest Opera too. But now latest Opera is not working with the site. Can You help me? How to solve this problem?
      Thank You!

      Reply Quote 0
        leocg 1 Reply Last reply
      • leocg
        leocg Moderator Volunteer @gydrus last edited by

        @gydrus The page seems to load fine here, does this cause any problem to access the site?

        A search for 'Ajax net::ERR_SPDY_PROTOCOL_ERROR' returned several results, did you try to check some of them?

        Reply Quote 0
          gydrus 1 Reply Last reply
        • gydrus
          gydrus @leocg last edited by

          @leocg Yes, page loads fine! but after authorization on site some ajax requests are not works. (
          Yes, i've tryed all recommendations given by google (clear cache, reset connections and so on), but they was not successfull (

          Reply Quote 0
            1 Reply Last reply
          • gydrus
            gydrus last edited by

            Yeah! I've found the solution!
            There is a request code example:

            $.ajax({
            	url: 'https://food-tracker.ru/foods',
            	type: 'POST',
            	dataType: 'JSON',
            	data: {term: 'rjk'},
            	success: function (data) {console.log(data);}
            });
            

            And there was server code:

            protected function returnJSON($data) {
                header('text/html; charset=utf-8');
                echo json_encode($data);
                die(0);
            }
            

            The solution is to change line header('text/html; charset=utf-8'); to header('Content-type: application/json; charset=utf-8');

            So, right working code is:

            protected function returnJSON($data) {
                header('Content-type: application/json; charset=utf-8');
                echo json_encode($data);
                die(0);
            }
            

            Thanks for your attention!

            P.S. But one question i still have: why was it working fine before, and brokes when just hosting changed?

            Reply Quote 0
              1 Reply Last reply
            • First post
              Last post

            Computer browsers

            • Opera for Windows
            • Opera for Mac
            • Opera for Linux
            • Opera beta version
            • Opera USB

            Mobile browsers

            • Opera for Android
            • Opera Mini
            • Opera Touch
            • Opera for basic phones

            • Add-ons
            • Opera account
            • Wallpapers
            • Opera Ads

            • Help & support
            • Opera blogs
            • Opera forums
            • Dev.Opera

            • Security
            • Privacy
            • Cookies Policy
            • EULA
            • Terms of Service

            • About Opera
            • Press info
            • Jobs
            • Investors
            • Become a partner
            • Contact us

            Follow Opera

            • Opera - Facebook
            • Opera - Twitter
            • Opera - YouTube
            • Opera - LinkedIn
            • Opera - Instagram

            © Opera Software 1995-2025