Coder Social home page Coder Social logo

node-shapeways's People

Contributors

bmcbarron avatar brettlangdon avatar d33psky avatar dhritzkiv avatar mboylevt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-shapeways's Issues

API response contains unparsable error.data string

The string contents of error.data look like a json object, but it is actually unparsable.

I made an example of something similar I am trying to do here: awongh@5ecee61

The specific string I am seeing is:

"{"result":"failure","reason":"You attempted to upload the file \"example\" which has an unsupported or missing file extension. We currently only support STL, OBJ, X3D, Collada, VRML97, VRML2 and ZIP file formats. Please ensure that your files are of one of our supported formats with the correct file extensions. If you can't export to those formats, please see our tutorial \"<a href='\/tutorials\/converting-with-accutrans-3d'>Converting with AccuTrans<\/a>\"."}{"result":"failure","reason":"Model Upload Failed. (Reason: 100)"}"

Can error.data be a valid json parseable string?

Thanks.

oauth invalid signature with POST

Getting invalid signature when doing any POST calls (like addModel), the error goes away when using PLAINTEXT rather than HMAC-SHA1

oauth_signature_invalid

I am consistenly getting a 401 oauth_signature_invalid when using the addModel function. Are you aware of any issue with the OAuth library?

Signature Invalid on POST requests

I've noticed this has been an issue more than once, I've looked at other posts about it but it failed to help me solve it.

I'm using the http example in the node-shapeways module, however instead of the getApiInfo call, I'm using the addModel call. The getApiInfo call works fine, as well as other GET functions, but I get a signature error on POST requests or at least in this case, addModel function.

User @giles7777 suggested I should make sure oauth uses headers with Accept and Content-Type set to application/json, I've done that in client.js in the client constructor on line 49

  this.connection = new oauth.OAuth(
        this.url("/oauth1/request_token/"),
        this.url("/oauth1/access_token/"),
        this.consumerKey,
        this.consumerSecret,
        "1.0A",
        this.authorizationCallback,
        "HMAC-SHA1",
        null,
        {"Accept" : "application/json",
         "Content-Type" : "application/json",
            "Connection" : "close",
            "User-Agent" : "Node authentication"
        }
    );

But that still didn't work, was still getting signature invalid error from oauth, I also tried switching to PLAINTEXT instead of HMAC-SHA1, but same results.
Could this problem be coming from the Shapeways API or the node module?

This is how I'm calling addModel, I am not encoding the file content because I know this module does that for me as I saw in the addModel function

var data = fs.readFileSync(modelFile);
var postData = {
    hasRightsToModel: 1,
    acceptTermsAndConditions: 1,
    title: "Test",
    description: "Just Testing",
    fileName : "couch.obj",
    file: data
};

client.addModel(postData, function(result){
    res.writeHead(200, {"Content-Type": "application/json"});
    res.end(JSON.stringify(result));
});

Is there anything wrong with the way I'm doing that? Please let me know how to solve this if you have any idea, thanks!

Add streaming API to model upload

"If I may presume to make one suggestion going forward, it would be that you consider adding a streaming API for uploading the models themselves. For performance reasons, I think that this is absolutely essential, especially when you are consuming larger models produced by external processes or redirected from disk. Globbing an entire mesh into memory for each upload can quickly consume all of the limited heap available to a node process and cause server crashes. Streams also implement back pressure which optimally handles performance and routing problems for throttling. I half-heartedly tried to get something like this to work in the older SOAP api, but was unsuccessful mostly due to the undue hassle of inserting a stream into the middle of a SOAP request and the general crappiness of the current options for handling SOAP/XML in node. However with the current REST system, I believe that this should be much easier to implement and that it really ought to be exposed as the default method for uploading."

From @mikolalysenko via e-mail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.