summaryrefslogtreecommitdiff
path: root/proxy
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-11 13:41:54 -0500
committerJules Laplace <jules@okfoc.us>2015-11-11 13:41:54 -0500
commit9d30013e953e570552cd86dbb2795ec56b8d1035 (patch)
treeccaec83e82e461f1206120e740e256bff96b2c08 /proxy
parentb1f7de54a87cff0f2a1d2b1837c5532c9c847be3 (diff)
delete item api working
Diffstat (limited to 'proxy')
-rw-r--r--proxy/index.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/proxy/index.js b/proxy/index.js
index 80cd6d4b..d84d3813 100644
--- a/proxy/index.js
+++ b/proxy/index.js
@@ -37,6 +37,10 @@ server.on('request', function (req, res){
options.hostname = 'secure.api.yoox.biz'
options.path = req.url
+if (req.method == "DELETE") {
+ console.log(options.headers)
+ console.log(req.url)
+}
req.pause()
var connector = https.request(options, function(server_res) {
console.log('>> GOT', server_res.statusCode)
@@ -58,6 +62,15 @@ server.on('request', function (req, res){
server_res.resume()
})
+ connector.on('response', function(e){
+ console.log(">> RESPONSE")
+ })
+ connector.on('connect', function(e){
+ console.log(">> CONNECT")
+ })
+ connector.on('error', function(e){
+ console.error(e)
+ })
if (DEBUG) {
req.on('data', function(s){ console.log('>>', s.toString()) })
}
@@ -85,7 +98,7 @@ function get_headers (h){
})
hh['Content-Type'] = 'application/json' // h['content-type']
if ('content-length' in h) hh['Content-Length'] = h['content-length']
- if ('connection' in h) hh['Connection'] = h['connection']
+ // if ('connection' in h) hh['Connection'] = h['connection']
return hh
}