Git Product home page Git Product logo

Comments (6)

fjogeleit avatar fjogeleit commented on May 26, 2024

hey, I'll have a look. What would be the expected key?

{
 "files[0]": "report.html file",
 "files[1]":" report.json file"
}

something like this?

from http-request-action.

mrcnk avatar mrcnk commented on May 26, 2024

Thanks for a quick reply, so the correct data for my CMS patch is:

CleanShot 2023-11-29 at 11 43 05@2x

Looks like it just doubles the same key without array index for the form data.

from http-request-action.

fjogeleit avatar fjogeleit commented on May 26, 2024

Could you please test if its working with fjogeleit/http-request-action@support-file-array?

I added a basic test action, so it looks good but would like your confirmation before I release it.

from http-request-action.

mrcnk avatar mrcnk commented on May 26, 2024

Sure, so my step looks like this:

- name: Upload Report
    uses: fjogeleit/http-request-action@support-file-array
    with:
      url: [Endpoint URL]
      method: POST
      contentType: multipart/form-data
      bearerToken: ${{ secrets.API_ADMIN_SECRET_KEY }}
      customHeaders: '{"Content-Type": "application/json"}'
      data: '{"jobId": "${{ github.event.inputs.jobId }}"}'
      files: '{"attachments": [".lighthouseci/report.html", ".lighthouseci/report.json"]}'

And when executed, I get a mimetype error:

{"code":400,"message":{"code":400,"message":"Something went wrong while processing your request.","data":{"attachments":{"code":"validation_invalid_mime_type","message":"\"report_vETdVgmY8E.html\" mime type must be one of: text/html, application/pdf, image/png, image/jpeg, application/json."}}}}

However, as you can see in the error message, text/html is allowed.

from http-request-action.

fjogeleit avatar fjogeleit commented on May 26, 2024

okay, thanks. I will check it.

from http-request-action.

fjogeleit avatar fjogeleit commented on May 26, 2024

sorry for the late response, can you find out what contentType the files have in your case? I tried different things and in the debug logs the content types look correct, so I am wondering what your backend receives as content type.

from http-request-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.