All Downloads are FREE. Search and download functionalities are using the official Maven repository.

oauth.requests.scala Maven / Gradle / Ivy

There is a newer version: 0.13.4
Show newest version
package dispatch.oauth

import com.ning.http.client.oauth._

import dispatch._

class SigningVerbs(val subject: Req) extends RequestVerbs {
  val emptyToken = new RequestToken(null, "")

  def sign(consumer: ConsumerKey, token: RequestToken = emptyToken) = {
    val calc = new OAuthSignatureCalculator(consumer, token)
    subject underlying { r =>
      calc.calculateAndAddSignature(r.build, r)
      r
    }
  }

  def <@(consumer: ConsumerKey, token: RequestToken = emptyToken) =
    sign(consumer, token)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy