I will need this writer most likely: Writer [294711] In this assignment, you wil
I will need this writer most likely:
Writer [294711]
In this assignment, you will:
· Get more practice with Go’s packages that support web services and interacting with them
Here are the requirements:
1) You need to write two programs,
a) hw7.go will be a simple service to add and lookup email contact info
b) hw7client.go will be a simple command-line user interface that will use the service to get its work done
2) To test the code, you need to first run the service in one window, then run the client in a separate window. Here is sample output, first for the service, then for the client:
a) Note that I ran the service inside VS Code’s Terminal window, which runs Powershell and thus needs the “.” first
b) Note that the service has not stopped
PS C:UsersvillaDownloads311gospr22cs311hw7> go build hw7.go
PS C:UsersvillaDownloads311gospr22cs311hw7> .hw7
c) I ran the client in a CMD window. I ran it twice without stopping the service, so the 2nd run can still access the data saved from the first run. For a real service, you would store things in a database, but for this assignment, a simple map is sufficient.
C:UsersvillaDownloads311gospr22cs311hw7client>hw7client
Managing email contacts
Add or Lookup (a/l)? a
Please enter the name: Bob Zane
Please enter the email address: bz@abc.com
Do you want to quit? (yes/no): no
Add or Lookup (a/l)? a
Please enter the name: Bonnie Kohl
Please enter the email address: bk@stu.edu
Do you want to quit? (yes/no): no
Add or Lookup (a/l)? l
Please enter the name: Bob Zane
The email address is: bz@abc.com
Do you want to quit? (yes/no): no
Add or Lookup (a/l)? l
Please enter the name: Bonnie Zane
Bonnie Zane is not in the contact list
Do you want to quit? (yes/no): yes
C:UsersvillaDownloads311gospr22cs311hw7client>hw7client
Managing email contacts
Add or Lookup (a/l)? l
Please enter the name: Bonnie Kohl
The email address is: bk@stu.edu
Do you want to quit? (yes/no): yes
C:UsersvillaDownloads311gospr22cs311hw7client>
3) The service is a stripped-down version of the web service from the tutorial you used in hw6
4) The client uses the http package’s get and post functions to submit requests to the service
a) io.ReadAll() helps extract the return value from the body of the response
b) The result can be cast to a string for a human-readable version
Grading:
Correctness 80%
To get any credit, you need to use HTTP requests and responses. Practicing how they work is the point.
Style: 20% for naming (abbreviations are ok), meaningful comments
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines
Order Paper Now