Media upload with OAuth1
aliazlan4 opened this issue · comments
Does OAuth1 supports media endpoint too?
When I send image content in "contents" parameter in body along with other OAuth1 parameter like token and signature etc then these parameters also concatenate with image content in image file which corrupts image file.
Kindly let me know how to upload image file to Wordpress Api with OAuth1 with guzzle.
Have a look at how this works.
https://gist.github.com/kosso/71c957e30a40116e5f98
Particularly line 319 for my oauthRequest() function and the _http() one below it. See how it detects if it's a file or not (L448) and sets the headers differently. : https://gist.github.com/kosso/71c957e30a40116e5f98#file-wp_api_oauth_test_client-php-L319
Hope this helps. It's been working for a long time.