Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

convert Node.JS webservice call to C#

$
0
0

Hi Folks,

I have an Node.JS script which is making a webservice call the script works great , i am looking to convert this Node.JS script to C# webservice call.

Can someone please help. Thanks in advance.

var request = require('request');
var fs = require('fs');
var url = "https://yoururl/API/v3/responseimports";
var surveyId = "SV_ePswPpv4rPD77fL";
var token="AXXXXXXXXXXXXXZZZZ";
var formData={
	surveyId:surveyId,
	file: fs.createReadStream("test.csv")
};

var options = {
	headers:{
		'content-type':'multipart/form-data',
		'X-API-TOKEN':token
	},
	method:"POST",
	url:url,
	formData: formData
};

request(options, function(error,response,body){
	if(error){
		console.log("Error" +error);
	}
	else{
		console.log(response.body);
		console.log("webservice call completed");
		console.log(response.statusCode);

	}

});


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>