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 send request with attachments #106

Closed
steventranjs opened this issue Sep 4, 2017 · 4 comments
Closed

Unable to send request with attachments #106

steventranjs opened this issue Sep 4, 2017 · 4 comments
Labels

Comments

@steventranjs
Copy link

steventranjs commented Sep 4, 2017

Description/Steps to reproduce

  1. I have this template
{
        template: {
          method: 'POST',
          url: 'http://localhost/some-ftp-server',
          headers: {
            accepts: 'multipart/form-data',
            'content-type': 'multipart/form-data'
          },
          attachments: [{ field: 'file', path: '/tmp/file.json' }]
        },
        functions: {
          sendFileToserver: []
        }
}
  1. Execute sendFileToserver will results in below error:
TypeError: Cannot read property 'form' of undefined
    at RequestBuilder.invoke (/Users/.../node_modules/loopback-connector-rest/lib/rest-builder.js:551:17)
    at Function.writeHdfsFile (/Users/.../node_modules/loopback-connector-rest/lib/rest-builder.js:439:17)

The issue is because variable r is NOT defined anywhere before line 551 in this file: https://github.com/strongloop/loopback-connector-rest/blob/master/lib/rest-builder.js (Line 551)

Expected result

  • Should be able to send the attachment.
@stale
Copy link

stale bot commented Nov 3, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 3, 2017
@stale
Copy link

stale bot commented Nov 17, 2017

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Nov 17, 2017
@mamartins
Copy link

mamartins commented May 3, 2018

Bumped into the same error. seems no one looked into it

@ketansp
Copy link

ketansp commented Jul 19, 2018

This issue should be re-opened

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

No branches or pull requests

3 participants