大量发布请求,发送带有其他参数的文件

时间:2019-02-27 17:08:22

标签: php guzzle guzzle6

我对Guzzle发送帖子文件有疑问。在API中,我有方法输入,例如文件(对于文件),名称和isPublic。我不知道如何发送这两个附加参数(文件名和isPublic,也许我理解错误的多部分参数?

我的例子

    $response = $client->request('POST', 'http://www.example.com/files/post', [
    'multipart' => [
        [
            'name'     => 'files' - its input name in api for files?
            'contents' => fopen('path/to/file', 'r')
            'filename' => 'csv_header.csv'
//Should I add additional param name and isPublic in this array, or somewhere else? 
    ]]]

请咨询。谢谢:)

0 个答案:

没有答案
相关问题