Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4153

Param is missing or the value is empty: user

$
0
0

I'm using Postman to test my API and I'm getting this error when making a call to http://localhost:3000/users.json to create a new user:

param is missing or the value is empty: user

All the parameters seem to be ok.

I set this in my application controller:

protect_from_forgery with: :null_session 

My controller method is the basic scaffold generated method:

def create  @user = User.new(user_params)  respond_to do |format|    if @user.save      format.html { redirect_to @user, notice: 'User was successfully created.' }      format.json { render :show, status: :created, location: @user }    else      format.html { render :new }      format.json { render json: @user.errors, status: :unprocessable_entity }    end  endend

What am I doing wrong?

EDIT:

Here's a screenshot of what I'm doing in Postman.

enter image description here


Viewing all articles
Browse latest Browse all 4153

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>