c# - How to set header value in asp.net web api -
i want able set header value/secret key in asp.net web api, can not use web service except or has secret key, , also, if set on api side, how user retrieves value/secret key on client side , use while consuming service.
i have tried this, not sure whether right. below code:
public iqueryable<paymentapi> getpaymentapi() { var re = request; var headers = re.headers; if(headers.contains("rtyuiopjhfghjuiopjklkljh")) { return db.paymentapi; } return null; }
thanks response.
Comments
Post a Comment