Как отправить мой запрос json с вложенным файлом - PullRequest
0 голосов
/ 02 октября 2019

Я хочу отправить мои данные JSON с изображением файла в то же время. Но когда я получу запрос json с request.get_json(), это ошибка.

вот мое чванство:

    parameters:
     - in: header
       name: Authorization
       type: string
       required: true
       description: add auth-token when available
     - in: formData
       name: podcasts_image
       type: file
       required: true
       description: image for this episode.
     - in: body
       name: parameters
       schema:
        type: object
        properties:
            title:
              type: string
              description: title podcasts
              default: Example Podcasts
            description:
              type: string
              description: description podcasts
              default: Describe your podcasts
            category_id:
              type: integer
              default: 17
            radios_id:
              description: fill this if you have radios
              type: integer
              default: 1
        required:
        - title
        - category_id
    consumes:
      - application/json
    produces:
      - application/json
    responses:
      200:
        description: list of s (if any)
        examples:
           {
          "data": [
            {
              "audio_url": "http://103.16.199.177:8300/;stream.mp3",
              "frequency": "98.6",
              "id": 19
            }
          ]
         }

я думаю, что мой код уже правильный, потому что когда я запускаю свой API на почтальоне, он работает!

Кто-нибудь может мне помочь?

...