Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. def obtainTealiumData(String tealiumAccount, String tealiumProfile) {
  2. def http = new HTTPBuilder("https://visitor-service.tealiumiq.com/datacloudprofiledefinitions/" + tealiumAccount + "/" + tealiumProfile)
  3. def results = null
  4. http.request(GET, JSON) {
  5.  
  6. headers.'User-Agent' = 'Mozilla/5.0 Ubuntu/8.10 Firefox/3.0.4'
  7. headers.Accept = 'application/json'
  8.  
  9. response.success = { resp, reader ->
  10. assert resp.statusLine.statusCode == 200
  11. results = reader.text
  12. }
  13.  
  14. response.failure = { resp ->
  15. results = null
  16. }
  17.  
  18. }
  19. return results
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement