1

I need to call an endpoint that requires the Request Header and Request Body with Content-type and content-length and some other property as well which need to End with BOUNDARY.

Request Header

POST https://www.API-URL.com/ HTTP/1.1
Host: www.API-URL.com
Content-type: multipart/mixed; boundary=BOUNDARY
Content-length: 1034

Request Body

--BOUNDARY
Content-type: application/x-www-form-urlencoded
Content-length: 141
AppVersion=1.0&AcceptLicenseAgreement=Yes&ResponseType=application/x-x-pld&VersionNumber=xxx&UserId=xxxx&Password=xxxxx

--BOUNDARY
Content-type: application/x-x-binary
Content-length: 6
020020  // This the string Data which I need to post

--BOUNDARY--

How can I implement a call to this endpoint by using HttpClient?

Thanks in advance

PKJI
  • 41
  • 5
  • Does this answer your question? [How do I make calls to a REST API using C#?](https://stackoverflow.com/questions/9620278/how-do-i-make-calls-to-a-rest-api-using-c) – Wyck Jul 15 '21 at 15:32
  • Oops, wrong link to duplicate. I think this may be what you're looking for: https://stackoverflow.com/questions/19954287/how-to-upload-file-to-server-with-http-post-multipart-form-data – Wyck Jul 15 '21 at 15:34

0 Answers0