15,905,913 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by AmitabhaGhosh123 (Top 10 by date)
AmitabhaGhosh123
2-Nov-20 9:30am
View
Hi Richard,
The same request is working fine in postman but not working while calling the api from code.
Below is the documentation for the update api.
POST Update Tasks
https://devza.com/tests/tasks/update
HEADERS
AuthToken {YOURTOKENHERE}
BODY formdata
message Do xxx something dasasa
due_date 2020-09-19 12:12:12
optional
priority 2
optional (1: normal, 2: mid, 3: high)
assigned_to 1
optional
taskid 1
AmitabhaGhosh123
2-Nov-20 9:26am
View
Below is the method for api :
updateTask(data) {
return this.http.post(this.apiBaseUrl + '/update', JSON.stringify(data),{
headers: new HttpHeaders({
"authtoken":'MMPIUq9bM8zRUFDWzc7XMMGt8jix38q9',
"content-type": 'application/json',
"accept": 'application/json'
})
})
}
Method for calling the api :
updateTask() {
this.updateObject['taskid'] = this.filteredObject['id'];
this.updateObject['message'] = this.filteredObject['message'];
this.updateObject['due_date'] = this.filteredObject['due_date'];
this.updateObject['priority'] = this.filteredObject['priority'];
this.updateObject['assigned_to'] = this.filteredObject['assigned_to'];
this.spinner.show('spinner1');
var data = [];
data.push(this.updateObject);
this.taskservice.updateTask(data).subscribe(res=>{
console.log(res);
$('#content').modal("hide");
this.spinner.hide('spinner1');
this.fetchAllTasks();
},
(error)=>{
this.spinner.hide('spinner1');
});
}
The api accepts formdata as input in the body section and apikey in headers.
AmitabhaGhosh123
7-Aug-20 11:01am
View
One more question .
Suppose I enter in the terminal node <filename> [2,3,4]
Do you have any idea how to change that into array?
AmitabhaGhosh123
7-Aug-20 11:00am
View
Actually I am taking the input from STDIN so I had to change it to Number before sending it to the recurSum function. Now it is working correctly.
AmitabhaGhosh123
7-Aug-20 10:20am
View
it is working now , but it is not summing up the values.
if I enter 2 , it is printing 21 instead of 3.
that is the below line is concatenating the values, not returning the sum.
return (n + recurSum(n - 1)).
AmitabhaGhosh123
7-Aug-20 5:23am
View
i am taking the input from command line.
i am calling the function like this.
recurSum(process.argv[2]) where process.argv[2] is the number given in the command line.
AmitabhaGhosh123
7-Aug-20 5:21am
View
the above solution is not working when in replace the return with console.log.
It is giving me the below output
3
3undefined.
AmitabhaGhosh123
7-Aug-20 3:44am
View
can you please help me to correct the code ?
AmitabhaGhosh123
7-Aug-20 3:34am
View
hi,
when i enter 1 in the command line , I get the sum as 1 which is correct.
But when I enter 2 or any other number , I get the below output.
1
2undefined
This is not the correct output which is wanted .
Desired output : It should print the sum from 1 till the number entered in the console.
AmitabhaGhosh123
6-Aug-20 14:05pm
View
Hi,
Can you please answer my 2nd question also?
Show More