How do I post an image file

I am trying to post an image file through the api

Im setting the body as binary and selecting the file

when this is sent im getting the following response :=

500 - Internal server error. < !-- body { margin: 0; font-size: .7em; font-family: Verdana, Arial, Helvetica, sans-serif; background: #EEEEEE; }
	fieldset {
		padding: 0 15px 10px 15px;
	}

	h1 {
		font-size: 2.4em;
		margin: 0;
		color: #FFF;
	}

	h2 {
		font-size: 1.7em;
		margin: 0;
		color: #CC0000;
	}

	h3 {
		font-size: 1.2em;
		margin: 10px 0 0 0;
		color: #000000;
	}

	#header {
		width: 96%;
		margin: 0 0 0 0;
		padding: 6px 2% 6px 2%;
		font-family: "trebuchet MS", Verdana, sans-serif;
		color: #FFF;
		background-color: #555555;
	}

	#content {
		margin: 0 0 0 2%;
		position: relative;
	}

	.content-container {
		background: #FFF;
		width: 96%;
		margin-top: 8px;
		padding: 10px;
		position: relative;
	}

	-->
</style>

Server Error

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

500 server error means the server had an issue processing the request. Posting an image to an API is very API specific.

Here is how I did it with a binary to the Wordpress API

This is still very specific to what the Wordpress API wants. They wanted this Content-Disposition header which may not be needed for other APIs. Dropbox for instance can take a URL of an image. Imgur may need it encoded. Every API is different.

Which API are you trying to submit an image to?