Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to make POST request but Every Time I get error.

Body of my post request is as below :

  Content-Disposition:form-data; name="request";
   {
      "recipients":["7778888"]
   }

So I made request and my Post Data is as below :

  string postData2 ="Content-Disposition:form-data; name=\"request\";" + Environment.NewLine + "{" + Environment.NewLine + "\"recipients\":[\"7778888\"]" + Environment.NewLine + "}";

But it didn't work and give me Invalid Recipient Value. I think I need to pass Recipient Values here as Array. How Can I pass "{" + Environment.NewLine + "\"recipients\":[\"7778888\"]" + Environment.NewLine + "}" as Array in this request ?

share|improve this question
a) Content-Disposition should be in the header, not in the body. b) Use a json parser instead of forming the string manually. – I4V Apr 22 at 17:01
Thanks , I will try with json parser – Hiren Apr 22 at 17:04

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.