Skip to content

Using HttpAgent for sending request to PicJs Server #80

@baolongt

Description

@baolongt

I'm developing this standard ICRC-112.

I want to send a request from client to PicJS server when I run unit test

This is my code

const agent = await HttpAgent.create({ host: process.env.PIC_URL });

The error I got

 The canister call cannot be executed: AgentHTTPResponseError [AgentError]: Server returned an error:
        Code: 404 (Not Found)
        Body: 

The reason I ask this because I want to test making canister call as a signer to canister while testing

Signer have to send this kind of request to canister instead using actor

   {
          "canisterId": "eeddf-fqaaa-aaaao-a2hlq-ca",
          "method": "icrc2_approve",
          "arg": "RElETARte24AbAKzsNrDA2ithsqDBQFsA/vKAQKi3pTrBgHYo4yoDX0BAwEdV+ztKgq7E4l1ffuTuwEmw8AtYSjlrJ+WLO5ofQIAAMgB"
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions