You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not possible to pass a body in a GET request ? #1764
I'd like to upgrade my project to use jsForce-lib version 3 (coming from version 1). We're using a nodejs based api, so i found it would be best to implement @jsforce/jsforce-node
While implementing the API, which we call by using the request method of the Connection, i ran into the issue that i can't find any way to pass a body correctly when issuing a GET request.
Code:
import jsforce from '@jsforce/jsforce-node'
import type { Connection, HttpRequest, HttpMethods } from '@jsforce/jsforce-node'
....
const api = await login() // 'api' is in our case the jsforce Connection which we obtain by invoking login()
const httpRequest: HttpRequest = {
url: path,
method: method as HttpMethods, // <-- which is in this case 'GET'
body: JSON.stringify(body), // <-- we should pass a stringified JSON
headers: {
'content-type': 'application/json',
},
}
const res = await api.request(httpRequest, {
retry: { maxRetries: 0 },
})
....
This resulted in an APEX error on de salesforce-API we're trying to implement.
Debugging the Salesforce counterpart of the call, we found that the body is a BLOB (0 bytes):
Activity