I am thinking about builing a windows forms app that create and publish new drupal nodes content.
Drupal related information:
node type is product witch has these fields:
title as string,
field_price as decimal,
field_main_image as a single image,
field_more_images as multiple images,
drupal has a web form to do that and that form has these details:
action = "http://localhost/commerce/node/add/product"
encrypt = "multipart/form-data"
accept-charset = "UTF-8"
method = "post"
text field title
fileupload field files[field_main_image_und_0]
text field field_price[und][0][value]
fileupload field files[field_more_images_und_0] (one for each additional image)
c# win forms related info:
textbox "title";
textbox "mainImageFilename" //with path
textbox "price"
that's alot of information and ofcourse I'm asking for helpting tips..
I wrote this code witch has alot of mistakes and holes...
HttpWebRequest req;
req = (HttpWebRequest)HttpWebRequest.Create("http://mydrupalsite.com/node/add/product");
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded"; //quest: is this ture?
//quest: how to add the data and files I want to upload to the request?
req.GetResponse();
could you help me doing that...