Issue #3++ #6

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
8 participants

ezarko commented Aug 24, 2011

Change "apiConfig.baseURL" to "apiConfig.host" since that is all it
really supports. Added "apiConfig.port". Removed paramString from URL
for POST/PUT. Added body for POST/PUT. Changed from http.request to
https.request if https protocol is used. Fixed edge case where API Key
is added to URL with no query string.

HTTP POST/PUT params, port numbers, HTTPS
Change "apiConfig.baseURL" to "apiConfig.host" since that is all it
really supports. Added "apiConfig.port". Removed paramString from URL
for POST/PUT. Added body for POST/PUT. Changed from http.request to
https.request if https protocol is used. Fixed edge case where API Key
is added to URL with no query string.

As soon as I have time to review and test, I'll incorporate or approve a pull request. Thanks!

What happen with this commit? Is it include in the latest stable version ?

@ezarko looks like a good start, but it looks like your commit just moves the query params to the body if it's a put/post. I think what we also need to add is the ability to post/put arbitrary JSON through a special textarea for put/post methods. I'll work on that.

Does somebody have an update on this functionality? We would also need to put/post json payloads, from textarea input to the API? Thanks!

There is a bug when appending the apiKey in the PUT/POST path for an unsecured request. You did not update the Content-Length header.

options.headers["Content-Length"] = Buffer.byteLength(options.body);

I did not check this for the OAuth path. But it should not be a problem there since the apiKey is not appended to the request body.

Otherwise, excellent addition. I'm surprised the original ever ran successfully for requests with only the API Key. It never did for me or any of the sample APIs.

lpa commented Jan 3, 2012

I suggest to add a mention to "apiConfig.port" config parameters you added in the documentation, and maybe an example of api configuration with the "port": "-whatever-" parameter

Merge remote-tracking branch 'origin/master'
Conflicts:
	README.md
	app.js
	public/data/apiconfig.json
Contributor

alexadkins commented Jul 24, 2014

See commit 8ff62fc

@alexadkins alexadkins closed this Jul 24, 2014

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