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

The Archive Base Latest Questions

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

I’m having issues getting a rest client written in Node.js to be able to

  • 0

I’m having issues getting a rest client written in Node.js to be able to send data (via GET) to a ServiceStack JSON-based Service. It’s giving me a serialization error. However, I’ve copied and pasted the same JSON (generated by my Node.js rest client) into a call to the ServiceStack Service sent via CURL and ServiceStack isn’t having an issue with the JSON–again…only as long as it is coming from CURL.

Any pointers or further enlightenment anyone can shed will be much appreciated!

Thanks,

Tami

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

    So I figured out how to get the above working in Node.js and not just in CURL (sending/receiving JSON to a ServiceStack JSON service).

    I did the following:

    • Use the “restler” package as my http communication wrapper
    • Use the “get()” method of restler…DO NOT USE THE “json()” METHOD
      (Code snippet follows…)

      var obj = {};
      obj.objectName = 'foo';
      obj.foos = [{firstname: 'foo1', lastname: 'foo-you'}, {firstname: 'foo2', lastname: 'foo-you-2'}];
      var json = JSON.stringify(obj);
      var options = {
          method: "get",
          data: json,
          headers: {'Content-type': 'application/json', 'Accept': 'application/json'}
      };
      rest.get('http://localhost/servicestack-api/getmethod', options).
          on('complete', function(data, response){
              console.log(data);
              console.log(response.statusCode);
      
          });
      
    • Make sure to fill in the above with the correct url and remote DTO to your ServiceStack service and method

    FYI

    If your json does not serialize to the remote DTO in ServiceStack, a quick way to test would be to copy and paste the json stored in the “json” variable above into a curl command to see if it serializes correctly that way.
    (Sample curl snippet below…)

    This is what I did initially (see original question) to try to trouble-shoot serialization issues. It helped me isolate the problem to the restler/Node.js side so I could make the modifications you see above–namely NOT using the “json()” method of restler.

        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X GET -d '{"foos":[{"firstname":"foo1","lastname":"foo-you"}, {"firstname": "foo2", "lastname": "foo-you-2"}],"objectName": "foo"}' http://localhost/servicestack-api/getmethod
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to construct a data frame in an Rcpp function, but when I
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I'm interested in microtypography issues on the web. I want a tool to fix:
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.