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

  • Home
  • SEARCH
  • 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 6343869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:31:49+00:00 2026-05-24T20:31:49+00:00

I have a Grails app running on 1.3.7 with the json-rest-api plugin version 1.0.8

  • 0

I have a Grails app running on 1.3.7 with the json-rest-api plugin version 1.0.8 installed. I’m trying to post data from the command line using curl in order to create a new instance of a domain class, but cannot seem to figure out the correct way to format the JSON so that the parser is satisfied. I can’t find any documentation either that would conclusively describe how the data is supposed to be formatted.

The domain class is defined like this:

package foo

class Foo {
  static expose = 'foo'

  String name

  static constraints = {
    name(inList: ['xyzzy', 'quux'])
  }
}

Given the above, this doesn’t work:

$ curl -X POST --header "Content-Type: application/json" --data-urlencode '{"name":"xyzzy"}' http://myapp/api/foo

The app returns a 500 error code and the content of the reply is

{"success":false,"message":"Property [name] of class [class foo.Foo] cannot be null"}

What kind of data does the API expect me to send?

  • 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-24T20:31:49+00:00Added an answer on May 24, 2026 at 8:31 pm

    Try the following format:

    { data: { name: "Blabla" } }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grails app that is using jsecurity plugin for authentication. How do
I regularly use right mouse button > Run/Debug Grails Command... from within NetBeans. When
I have a Grails app where people login through Spring Security. Their user domain
I have a grails app configured with spring-security-core and I need to allow Facebook
I've ran into an issue while trying to put together a Grails app with
I have what will become an 'external' activemq server I'd like grails to be
I am showing a grails app to some colleagues on a public domain. So
I see a number of posts on the various problems folks have with troubleshooting
I'm experimenting with grails in order to interface with an online trading platform. specifically
First I need to apologize for the long post, I struggle with being overly

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.