Skip to content

How to convert object to string in frisby? #508

Description

@SumanaRameshBaswan

I am using axios to make http requests, I have a form data to be sent which i am passing as shown below

function addrequestData (token) {
const form = new FormData();
form.append('dateOfJoining', '360112000');
form.append('selectedGroups', JSON.stringify([1])); // [1] data has to be sent in a JSON format
form.append('jobLocation', '1' );

const httpHeaders = form.getHeaders();
httpHeaders.Authorization =  token;
const httpObj = {
    headers: httpHeaders,
    url:     '/admin/hr/addEmployeeBasicInfo',
    data:    form
};
const id = requestData(httpObj, false);

return id.then(({ userInfo }) => {
    return userInfo['createdUserId'];
});

}
My question is How do I make sure that [1] gets converted to string in frisby?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions