Bonjour,
J'ai un problème pour joindre un fichier CSV dans l'utilisation d'un Web Service.
Je pense que le problème vient de l'appel de mon fichier, mais je ne vois pas comment le corriger.
Voici mon code :
namespace SendProductData
{
classSendProductData
{
staticvoidMain(string[] args)
{
string upload_file = @"d:\BLABLA\prod.csv";
string url_link = "https://BLABLA.com/index.php?d=webServices_Server&c=ServerRest&rm=importFileContr&rf=importProduct&sl=e3068BLABLABLABLAbf8d04&FILENAME=";
HttpWebRequest WebReq = WebRequest.Create(url_link + upload_file) asHttpWebRequest;
WebReq.ContentType = "UTF-8";
WebReq.Method = "POST";
WebReq.ContentLength = 0;
WebReq.Credentials = newNetworkCredential("LOGIN-BLABLA", "MDP-BLABLA");
using (HttpWebResponse response = WebReq.GetResponse() asHttpWebResponse)
{
// Get the response stream
StreamReader reader = newStreamReader(response.GetResponseStream());
// Console application output
Console.WriteLine(reader.ReadToEnd());
response.Close();
}
}
}
}
Avez-vous une solution ?
Merci pour votre aide.