1

I post a file using form-data but file is uploading corrupted. I need to post it as binary. How can I do it in Java using HttpClient?

"Content-Type": "application/octet-stream"

Sahi Repswal
  • 190
  • 3
  • 12

1 Answers1

0

We can set it like below:

post.setEntity(new FileEntity(file));
Sahi Repswal
  • 190
  • 3
  • 12