# Rewriting a "multipart/form-data" request to a "binary" "x-www-form-urlencoded" request

**URL:** <https://www.ruby-forum.com/t/rewriting-a-multipart-form-data-request-to-a-binary-x-www-form-urlencoded-request/243852>\
**Category:** NGINX\
**Created:** [January 17, 2016, 1:24am UTC](https://www.ruby-forum.com/t/rewriting-a-multipart-form-data-request-to-a-binary-x-www-form-urlencoded-request/243852 "2016-01-17T01:24:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [January 17, 2016, 1:24am UTC](https://www.ruby-forum.com/t/rewriting-a-multipart-form-data-request-to-a-binary-x-www-form-urlencoded-request/243852/1 "2016-01-17T01:24:37Z")

</div>

Hi, everyone!

I would like to know if there’s a simple way to have Nginx rewrite a  
“multipart/form-data” request to a “x-www-form-urlencoded” request with  
only a (binary) file as the content.

That is, I want the rewritten request to look like it was produced with  
the  
Curl --data-binary option.

The reason I want to do this is because I’m working with a backend  
service  
that only supports this file encoding.

Thanks in advance!

All the best,  
Jon
