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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:06:44+00:00 2026-06-14T07:06:44+00:00

I have a HighCharts client whose responsibility is to load data from a webservice

  • 0

I have a HighCharts client whose responsibility is to load data from a webservice and show a chart. The function that requests data looks as below:

function requestData() {
    $.ajax({
        url:  'http://myhost.com/type?x=1&y=2&z=3',
        headers: { 
          Accept : "application/json"
        },
        type: "GET",
        dataType: "json",
        success: function(data) {
          //do something
        },
        cache: true
    });
}

(in the future, the url property will be dynamically generated)

The target webservice is read-only and implemented using Flask microframework: its purpose is to return JSON data to the HighCharts client. This is the Flask view (function) taking care of data requests:

@app.route('/<type>')
def get_data(type):

    x = request.args.get('x','')
    y = request.args.get('y','')
    z = request.args.get('z','')

    [...]

Problem: when I execute the javascript code in Chrome, the following HTTP request is sent to the webservice:

GET /type?x=1&amp;y=2&amp;z=3 HTTP/1.1  // '&' have been escaped to '&amp;'
Host: myhost.com
Connection: keep-alive
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
Accept: application/json
Referer: http://myhost.com/chart.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

…I get a 404 status code (Bad Request) from the server, which is perfectly good and expected whenever one or more of the request’s query parameters is null or malformed:

HTTP/1.0 400 BAD REQUEST
Content-Type: text/html; charset=utf-8
Content-Length: 16
Server: Werkzeug/0.8.3 Python/2.7.3
Date: Wed, 14 Nov 2012 10:23:49 GMT

After debugging on my Flask webservice I noticed that only the x query parameter (which please note is the first given in the HTTP request) is correctly parsed, while y and z are empy strings, which causes the 404.

Why is it happening? Any charset inconsistency regarding the & -> &amp; escaping?

Thanks, any hint would be of real help (just ask if you need more specs or code)

  • 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-14T07:06:45+00:00Added an answer on June 14, 2026 at 7:06 am

    I think the error is as you expected the escaped ampersand.

    Try this:

    function requestData() {
        $.ajax({
            url:  'http://myhost.com/type',
            headers: { 
              Accept : "application/json"
            },
            data: {
                x: 1,
                y: 2,
                z: 3
            },
            type: "GET",
            dataType: "json",
            success: function(data) {
              //do something
            },
            cache: true
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a column chart in Highcharts that looks roughly like this: | |
I have a highcharts that renders data according to data in my database. I
I have a chart that looks like this: I want to remove the text
I have this HighCharts chart that has more than 50 values on the x-asis.
I have to do a column chart using highcharts that has 1px space between
I have what I'd consider a relatively simple Highcharts chart that I want to
I have a highcharts line graph that shows sales data. Is there a way
I have a rendered Highcharts chart on a website and I need to empty
I have a very simple highcharts js chart, which has dates on x-axis and
I have a chart in Highcharts (to be more specific: it's a Highstocks chart,

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.