I am trying to send this request through a POST using Go.
curl https://api.onfido.com/v2/applicants/1030303-123123-123123/documents \
-H 'Authorization: Token token=your_api_token' \
-F 'type=passport' \
-F 'file=@localfile.png;type=image/png'
At this moment I can't figure out how to deal with the -F parameter.
I've created the following struct
type DocumentRequest struct {
Type string `json:"type"`
File string `json:"file"`
}
which I am sending through:
res, err := s.Post(assembleURL(“https://api.onfido.com/v2/applicants/", userID, "documents"), d, doc, &apiErr)
where d
is my DocumentRequest.
Any tips on how to solve it?
Thanks!