0

I have set up a services endpoint using services module and I am using Mozilla Poster add on to test it. I was able to create a user by sending data from Mozilla Poster in x-www-form-urlencoded format with parameter names "name", "pass" and "mail". Now I am trying to create a node but it is showing the error: "Title field is required".

What should be the parameter name for title field to be sent to the services endpoint? I tried using "title", "field_title" etc but it is not recognizing it. There is a nice tutorial here to determine data structure to be sent to create a node at remote website. But this tutorial tells how to send data in json format. I want to send data in x-www-form-urlencoded and create a simple node. The HTML code of title field of node create form at my remote website is:

<input class="text-full form-text required" id="edit-title-field-und-0-value" name="title_field[und][0][value]" value="" size="60" maxlength="255" type="text">

Kindly help me to figure out correct format to send title value in x-www-form-urlencoded format from Mozilla Poster in order to create a node.

4
  • 1
    Use postman extension on Google-chrome.
    – shrish
    May 30, 2014 at 17:12
  • hello sir, thank you very much for your help. I tried postman extension also but it is throwing the same error "title field is required". What should be the "key" for node title? I tried entering "title", "field_title", "title_field" etc. None is working. How to determine "key" of the remote node field? Please help. I could not find any guide anywhere about this.
    – user30153
    May 30, 2014 at 20:30
  • please can you specify all the machine-names of fields you have in your content-type? of which you want to create node.
    – shrish
    May 30, 2014 at 22:58
  • Sir @shrish , right now I want to post a simple node with only "title" field and machine name of that field is "title_field". I tried "title_field" as key but it did not work. Please guide sir.
    – user30153
    May 30, 2014 at 23:56

1 Answer 1

1

In the html code of node add form as provided by you, title field has name "title_field[und][0][value]". You have to use exactly this name/key in your POST request. Along with that, you also need to send a value with name/key "title". Both needs to be sent. However the value of "title_field[und][0][value]" will be filled as title in the created node.

1
  • woha! This worked. Any specific reason for sending "title" as well as "title_field[und][0][value]"?
    – user30153
    May 31, 2014 at 1:01

Your Answer

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

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