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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:33:03+00:00 2026-05-15T07:33:03+00:00

I am trying to send a JSON data to a Sinatra app by RestClient

  • 0

I am trying to send a JSON data to a Sinatra app by RestClient ruby API.

At client(client.rb) (using RestClient API)

response = RestClient.post 'http://localhost:4567/solve', jdata, :content_type => :json, :accept => :json

At server (Sinatra)

require "rubygems"
require "sinatra"


post '/solve/:data' do 

  jdata = params[:data]

  for_json = JSON.parse(jdata)

end

I get the following error

/Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient/abstract_response.rb:53:in `return!': Resource Not Found (RestClient::ResourceNotFound)
    from /Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient/request.rb:193:in `process_result'
    from /Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient/request.rb:142:in `transmit'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
    from /Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient/request.rb:139:in `transmit'
    from /Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient/request.rb:56:in `execute'
    from /Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient/request.rb:31:in `execute'
    from /Library/Ruby/Gems/1.8/gems/rest-client-1.5.1/lib/restclient.rb:72:in `post'
    from client.rb:52

All I want is to send JSON data and receive a JSON data back using RestClient and Sinatra..but whatever I try, I get the above error. I m stuck with this for 3 hours. Please help

  • 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-05-15T07:33:03+00:00Added an answer on May 15, 2026 at 7:33 am

    Your sinatra app, don’t match with http://localhost:4567/solve URL, so it’s return a 404 from your server.

    You need change your sinatra app by example :

    require "rubygems"
    require "sinatra"
    
    
    post '/solve/?' do 
      jdata = params[:data]
      for_json = JSON.parse(jdata)
    end
    

    You have a problem with your RestClient request too. You need define the params name of jdata.

    response = RestClient.post 'http://localhost:4567/solve', {:data => jdata}, {:content_type => :json, :accept => :json}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send data, in json format to my webservice, using POST.
what im trying to do is to send data in JSON using jquery to
I'm trying to send JSON data to a server. RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
I am trying to send JSON data from a form using the XMLHttpRequest object.
I'm trying to send the node instance JSON data using an ajax get request
I'm trying to POST some JSON data using Adobe Flex but having some problems.
I am trying to send data to Gsoap server using JSON object using android
I'm trying to send JSON data (demographics) to a new page (within the same
I am trying to send JSON data to a web server via the code
I'm trying to send to the client with django python a json string with

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.