I want to write a function for uploading photos to flickr as http://www.flickr.com/services/api/upload.api.html. I wrote the following code:
val http = new Http with thread.Safety
val uploadEndPoint = :/("api.flickr.com") / "services" / "upload"
then I sign the method using dispatch
def signUploadRequest(userParams: Map[String, String], accessToken: Token, verifier: String): Map[String, String] = {
var map = userParams
map += "api_key" -> consumerKey
sign("", uploadEndPoint.toString, userParams, consumer, Some(accessToken), Some(verifier), Some(OAuth.oob))
}
Then I call the following method:
def sendUploadRequest(reqParms: Map[String, String]) = { http(uploadEndPoint.POST <:< reqParms as_str) }
but I got the following error:
<rsp stat="fail">
<err code="100" msg="Invalid API Key (Key has invalid format)" />
</rsp>
I use the same procedure for requests and it works fine. What is the problem with the Post?
Thanks, Feras