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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:14:16+00:00 2026-06-05T01:14:16+00:00

I’m calling the Firebase REST API from a Node.js process. The problem I’m seeing

  • 0

I’m calling the Firebase REST API from a Node.js process. The problem I’m seeing is that POSTS fail when the post body contains non-ASCII characters. This is despite the request returning a “200” status, and the name of a node (which doesn’t actually get created).

I’m currently trying something like this:

function push(path, object, callback) {
    console.log("Pushing to "+path+" on: "+firebase.host);
    var fullPath=firebase.basePath+path;
    console.log("fullPath="+fullPath);
    var body = JSON.stringify(object);
    var options = {
        host: firebase.host,
        port: 80,
        method: "POST",
        path: fullPath, //gamma.firebase.com/...
        agent: false,
        headers: {
            'content-type': 'application/json',
            'Content-Length': body.length,
         }
    };
    var req = http.request(options, function(response) {
        var result = "";
        console.dir(response.headers);
        response.on('data', function(chunk) {               
            result+=chunk;
        });
        response.on('end', function() {
            console.error("POST response result: "+result);
            try {
                callback(JSON.parse(result));
            } catch(e) {
                callback({ error: e });
            }
        });
        response.on('error', function(e) {
            console.error("POST response error: "+error);
            callback({error: e});
        });
    });
    req.on('error', function(error) {
        console.error("POST request error: "+error);
    });
    req.write(body);
    req.end();
}

The contents of “object” can be as simple as:

{"text": "test\u00a0text"}

The result I get back is status 200, and an reasonable-looking child name, which doesn’t actually get created.

I’ve tried setting content-type to a bunch of different things (adding ; charset=”UTF-8″, for example), and it doesn’t seem to affect the results at all.

  • 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-05T01:14:17+00:00Added an answer on June 5, 2026 at 1:14 am

    There is an error in the way we are handling certain types of input which is yielding the erroneous 200 status. We will roll out a fix shortly. To work around the problem in the meantime you can omit sending the Content-Length header. This will allow you to post ASCII and non-ASCII data.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm trying to create an if statement in PHP that prevents a single post
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.