This might be a dumb "How does the Internet work" kind of question.

I have been asked to pull data from Omniture, using the Omniture API.
I thought this would take me an hour, but I've been working on this
for 3 days now. I keep getting authentication errors.

I became curious about exactly what code was sending to Omniture, so I
downloaded Charles, the network debugging tool:

http://www.charlesproxy.com/

I am using clj-http to make the POST. The post is suppose to be
https.

This is the thing that surprises me: If I use http then I can see all
the headers in Charles, and they all look correct. But if I use https
(which is what I need to use) then there are no headers that I can see
in Charles.

Is that because Charles does not want to show me a bunch of encrypted
garbage? Or is clj-http not adding in the headers with https? Maybe I
need a special setting to get clj-http to correctly send to https? (I
have not been able to find any such setting.)

This is the code where I use clj-http (here I call http-client):

(defn omniture-call-api [url-with-queue-method api-payload headers]
  (timbre/spy :debug " return value of omniture-call-api "
              (try+
                (http-client/post url-with-queue-method
                                  {:body api-payload
                                   :headers {"X-Api-Version" "2"
                                             "X-WSSE" headers}
                                   :content-type :json
                                   :socket-timeout 4000
                                   :conn-timeout 4000
                                   :accept :json
                                   :client-params
{"http.protocol.allow-circular-redirects" false
                                                   "http.useragent"
"clj-http"}})
                (catch Object o (println (pp/pprint o))))))

The url is:

https://api2.omniture.com/admin/1.3/rest/?method=Report.QueueRanked

At first I assumed this was a problem with Omniture's code. I have
asked several question on the Developer forum at Omniture, but no one
there could help me (Adobe has apparently cut most of the developer
support since Adobe bought Omniture in 2009). However, I am now
wondering if maybe I am doing this POST incorrectly.

I am puzzled by something else as well: I call this function once, yet
Charles shows 4 calls being made to Omniture, and my own code, when it
prints data to the terminal, seems to show many requests being made.
Why would that be?

Again, if I change the URL so it uses "http" then in Charles I can see
all the headers that suppose to be in this line of code:

"X-WSSE" headers

and the headers look correct (I posted them to the developer forums at
Omniture and the one guy from Omniture who gave it a look felt there
was nothing terribly amiss -- but he couldn't rule anything out.)

But If I change the URL to use https, then I see no headers in
Charles. Why is that?

---- lawrence







-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to