[
http://opencast.jira.com/browse/MH-8887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31062#comment-31062
]
Chris Colvard commented on MH-8887:
-----------------------------------
I've finally gotten around to doing this. I don't have wiki privileges so
could someone please copy the ruby example below to the page? Thanks!
require 'net/http/digest_auth'
require 'uri'
uri = URI.parse("http://localhost:8080/workflow/statistics.json")
@http = Net::HTTP.new uri.host, uri.port
uri.user = "matterhorn_system_account"
uri.password = "CHANGE_ME"
head = Net::HTTP::Head.new uri.request_uri
head['X-REQUESTED-AUTH'] = 'Digest'
res = @http.request head
req = Net::HTTP::Get.new(uri.request_uri)
digest_auth = Net::HTTP::DigestAuth.new
auth = digest_auth.auth_header uri, res['www-authenticate'], req.method
req.add_field 'Authorization', auth
res = @http.request req
puts res.body
> Examples of connecting to MH rest endpoints from different languages.
> ---------------------------------------------------------------------
>
> Key: MH-8887
> URL: http://opencast.jira.com/browse/MH-8887
> Project: Matterhorn Project
> Issue Type: Task
> Components: Architecture & Services
> Affects Versions: 1.4
> Reporter: Christopher Brooks
> Fix For: Trunk
>
>
> A set of recipes to connect to a few of the MH APIs would be valuable. From
> bash, ruby, ython, .net, etc. Especially those that include some
> authentication. Chris from Variations on Video has a gem that serves as the
> impetus here.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
http://opencast.jira.com/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn
To unsubscribe please email
[email protected]
_______________________________________________