stefanprodan / WebApiThrottle

ASP.NET Web API rate limiter for IIS and Owin hosting
MIT License
1.28k stars 274 forks source link

How can I response a json result with QuotaExceededMessage instead of a string? #124

Open Sharewithyou opened 6 years ago

Sharewithyou commented 6 years ago

I Try to user it as folllowing: QuotaExceededMessage = JsonConvert.SerializeObject(new ApiResult(429001, "it use frequently,only allow {0} per {1}"),please wait a moment")) but it don't support , I just want to response a custom json result , how can I to implement

glga-byte commented 5 years ago

You can do that with QuotaExceededContent: QuotaExceededContent = (rateLimit, key) => new { property="value" }