您将如何在赛普拉斯中发送带有PFX证书的请求?

问题描述

有人成功通过Cypress提交带有PFX证书的请求吗?如果可能,请分享。我遇到了未授权错误。谢谢您的帮助。

/// <reference types="Cypress" />
describe('Submit A Cafe Order Test',() => {

  const endPoint='https://0.0.0.77:9000/spc/api/v1/order/receive';


  it("Standard In-store API Order Test",() => {

    const options = {
      method: 'PUT',url: endPoint,"pfx": "H:/API_Info/Certificates/spc.device.client.722.pfx","passphrase": password,body: { 
       .....omitted...

      }
    }

    cy.request(options)
          .then(function(response){
              expect(response.status).to.equal(200);
          });
    });

})

解决方法

似乎已经有一个公开的 PR (https://github.com/cypress-io/cypress/pull/15179)。我们必须希望它尽快合并。