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

NSCocoaErrorDomain Code=3840 Error #6

Closed
jrlanders opened this issue Jul 15, 2016 · 2 comments
Closed

NSCocoaErrorDomain Code=3840 Error #6

jrlanders opened this issue Jul 15, 2016 · 2 comments

Comments

@jrlanders
Copy link

jrlanders commented Jul 15, 2016

Hi Sean,
The new version remove the put Error I was getting. I am trying to use the Put method to send a file. The interface is for a project called Agiloft. The rest method I am using requires, "Attaches the file passed in the body of the request to the specified field of the record identified by the supplied primary key." I am still trying to figure out how to upload it that what. It is a PDF file and I don't see to understand it yet. The Agiloft indicates that if it were an HTML for it should look like this:
** Characters removed to display **
form method="post" action="https://xxxxxxxx.com/ewws/EWAttach" enctype="multipart/form-data"> input name="$KB" value="Demo" /> input name="$table" value="case" /> input name="$lang" value="en" /> input name="$login" value="admin" /> input name="$password" value="qwerty" /> **input type="file" name="inbound_attachments"/>** input type="submit" value="submit" /> /form>

The error mentioned int he subject line is happening when I try and do a GET. I was not having that issue before the new release. CORRECTION I have resolved the issue mentioned in the subject line but and still working on the file upload issue.

Any Thoughts?

Thanks for all your hard work on this project!

@sean7512
Copy link
Owner

@jrlanders Thanks so much for using my library.

At this time, RestEssentials does NOT support multipart file uploads. RestEssentials deals with JSON data types only. If you can change the server, the way you can do it is to have the server accept JSON that looks like:

{
    "fileName": "someFile.png",
    "fileData": "base64EncodedStringOfFile"
}

If you cannot change the server, then there are a few options...

  1. Add the support to RestEssentials and create a pull request to merge it back into the library.
  2. Use AlamoFire. AlamoFire is a much more heavyweight library, but it does support multipart file uploads. If you go this route, can you please create an issue on my library requesting the feature and I may add it in a future release.

Thanks again!

@sean7512
Copy link
Owner

@jrlanders I am going to close this issue since you resolved it. If you do not plan on updating the library for file uploads, then please open an issue requesting that feature.

Thanks again.

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

2 participants