GithubHelp home page GithubHelp logo

4.0.0 Params Empty/Missing? about sinatra HOT 2 CLOSED

daBee avatar daBee commented on June 10, 2024
4.0.0 Params Empty/Missing?

from sinatra.

Comments (2)

dentarg avatar dentarg commented on June 10, 2024

I can't reproduce

curl --data "foo=bar" localhost:5050/login yields this output

$ bundle e puma -p 5050
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 60360
* Listening on http://0.0.0.0:5050
Use Ctrl-C to stop
POST /login
params
{"foo"=>"bar"}
127.0.0.1 - - [23/Jan/2024:11:10:50 +0100] "POST /login HTTP/1.1" 200 - 0.0008

$ cat -n Gemfile Gemfile.lock app.rb config.ru
     1	# frozen_string_literal: true
     2
     3	source "https://rubygems.org"
     4
     5	# gem "rails"
     6
     7	gem "sinatra", "~> 4.0"
     8
     9	gem "puma", "~> 6.4"
     1	GEM
     2	  remote: https://rubygems.org/
     3	  specs:
     4	    base64 (0.2.0)
     5	    mustermann (3.0.0)
     6	      ruby2_keywords (~> 0.0.1)
     7	    nio4r (2.7.0)
     8	    puma (6.4.2)
     9	      nio4r (~> 2.0)
    10	    rack (3.0.8)
    11	    rack-protection (4.0.0)
    12	      base64 (>= 0.1.0)
    13	      rack (>= 3.0.0, < 4)
    14	    rack-session (2.0.0)
    15	      rack (>= 3.0.0)
    16	    ruby2_keywords (0.0.5)
    17	    sinatra (4.0.0)
    18	      mustermann (~> 3.0)
    19	      rack (>= 3.0.0, < 4)
    20	      rack-protection (= 4.0.0)
    21	      rack-session (>= 2.0.0, < 3)
    22	      tilt (~> 2.0)
    23	    tilt (2.3.0)
    24
    25	PLATFORMS
    26	  x86_64-darwin-21
    27
    28	DEPENDENCIES
    29	  puma (~> 6.4)
    30	  sinatra (~> 4.0)
    31
    32	BUNDLED WITH
    33	   2.4.22
     1	require "sinatra"
     2	post "/login" do
     3	  puts 'POST /login'      # ==> POST /login
     4	  puts 'params' unless params.empty?
     5	  puts 'no params' if params.empty?      # ==> no params
     6	  puts params      # ==> {}
     7	end
     1	require_relative "app"
     2	run Sinatra::Application

from sinatra.

daBee avatar daBee commented on June 10, 2024

Ya all kinds of things have gone wrong so I'm taking a new approach. I'll close.

from sinatra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.