File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
user_guide_src/source/libraries Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ if it's not already set:
260260
261261.. literalinclude :: curlrequest/024.php
262262
263- .. note :: ``form_params`` cannot be used with the `` multipart`` option. You will need to use one or the other.
263+ .. note :: ``form_params`` cannot be used with the `multipart`_ option. You will need to use one or the other.
264264 Use ``form_params `` for ``application/x-www-form-urlencoded `` request, and ``multipart `` for ``multipart/form-data ``
265265 requests.
266266
@@ -306,13 +306,15 @@ multipart
306306=========
307307
308308When you need to send files and other data via a POST request, you can use the ``multipart `` option, along with
309- the `CURLFile Class <https://www.php.net/manual/en/class.curlfile.php >`_. The values should be an associative array
310- of POST data to send. For safer usage, the legacy method of uploading files by prefixing their name with an `@ `
309+ the `CURLFile Class <https://www.php.net/manual/en/class.curlfile.php >`_.
310+
311+ The values should be an associative array
312+ of POST data to send. For safer usage, the legacy method of uploading files by prefixing their name with an ``@ ``
311313has been disabled. Any files that you want to send must be passed as instances of CURLFile:
312314
313315.. literalinclude :: curlrequest/028.php
314316
315- .. note :: ``multipart`` cannot be used with the `` form_params`` option. You can only use one or the other. Use
317+ .. note :: ``multipart`` cannot be used with the `form_params`_ option. You can only use one or the other. Use
316318 ``form_params `` for ``application/x-www-form-urlencoded `` requests, and ``multipart `` for ``multipart/form-data ``
317319 requests.
318320
Original file line number Diff line number Diff line change 11<?php
22
3- $ post_data = [
4- 'foo ' => 'bar ' ,
5- 'userfile ' => new \CURLFile ('/path/to/file.txt ' ),
6- ];
3+ $ client ->request ('POST ' , '/post ' , [
4+ 'multipart ' => [
5+ 'foo ' => 'bar ' ,
6+ 'userfile ' => new \CURLFile ('/path/to/file.txt ' ),
7+ ],
8+ ]);
You can’t perform that action at this time.
0 commit comments