2

I'm trying to create a node using jQuery to POST JSON.

I get the following error returned by the server: Failed to load resource: the server responded with a status of 406 (Not Acceptable: Node type is required)

However, the type is definitely specified in my JSON string:

var data = '{"title":"Sample post ",
  "type":"article",
  "field_link":
            [{
             "url":"http://www.google.com", 
            "title":"My title"
            }],
  "body":
            {
             "und":[{"value":"comments about something"}]
             }
  }';
1

1 Answer 1

1
  1. try to observe the order of fields like: type > title > body > fields
  2. that is the widget type of "field_link"?
  3. add "und" to this field

    {"title":"Sample post ",
    "type":"article",
    "body":{
    "und":[{
    "value":"comments about something"}]},
    "field_link":{
    "und":[{
    "url":"http://www.google.com",
    "title":"My title"}]}}
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.