Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to invoke POST request of /tasks/create/submit in NodeJs #506

Open
meetrajsinh-crest opened this issue Sep 15, 2021 · 0 comments
Open

Comments

@meetrajsinh-crest
Copy link

meetrajsinh-crest commented Sep 15, 2021

Hello Team,

I am trying to invoke the POST request of /tasks/create/submit in NodeJs with files parameter and also attaching the file, but unable to get the task-ids, though i can get the 200 status code and also get the submit id.

var request = require('request');
var fs = require('fs');
var options = {
  'method': 'POST',
  'url': 'http://localhost:8090/tasks/create/submit',
  'headers': {
    'Content-Type': 'multipart/form-data',
    'Authorization': 'Bearer SAMPL3'
  },
  formData: {
    'files': {
      'value': fs.createReadStream('/root/testingfile.txt'),
      'options': {
        'filename': '/root/testingfile.txt',
        'contentType': null
      }
    }
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Can someone help me out?

Note: When I hit the curl command with files parameter it gives expected output with task-ids and submit id. And also it does not give proper output in Postman as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant