I want to add http methods dyamicly based on my conditions.
var obj = {
fieldType:"button"
label:"Submit"
method:"put" //get, post, delete, etc...
name:"submit"
submitUrl:"http://apiurl.com"
type:"submit"
}
How to assign coming object method in http.
if( obj.method ){
this.http.obj.method('www.google.com')
...
}
EDIT:
I forgot you want it for
angular4. The request signature is different then:In
angular5the the method can be set in theRequestOptionsAnd the HttpClient has a
requestmethod for this purpose.