Question: /** * q1: Write a public static method named q1 that takes an int as a parameter and returns an * int. This method will
/** * q1: Write a public static method named q1 that takes an int as a parameter and returns an * int. This method will first send a GET request to a server with the url * "https://fury.cse.buffalo.edu/ps-api/type-four" and a query String with three int values * of 75, 73 and the input parameter of this method in this order with names of "first", * "second", and "third" respectively. The response from the server will be a CSV formatted * String with two well-formed ints as values. Then make a POST request to the same url (no * query String) where the text in the body of the request is a CSV String containing the * same two values from the response of the GET request but in the reverse order. For * example, if the response from the GET request was "75,36", then the body of your POST * request should be "36,75". The response from the POST request will again be a CSV String * with two well-formed ints. Finally, return the sum of the two ints in the response of the * POST request */
/** * q5: Write a public static method named q5 that takes an int as a parameter and returns an * int. The returned int will be the response from the server after sending a GET request to * the url "https://fury.cse.buffalo.edu/ps-api/type-two" with a query String containing * "rhythm" with value 98, and "lucky" with value 49 as well as "input" with a value equal to * the int from the input of this method. The response from the server will be a String that * is a well-formed int */ ?
/** * q3: Write a public static method named q3 that takes an int as a parameter and returns an * int. The returned int will be the response from the server after sending a GET request to * the url "https://fury.cse.buffalo.edu/ps-api/type-two" with a query String containing * "wilderness" with value 28, "super" with value 76, and "fleet" with value 91 as well as * "input" with a value equal to the int from the input of this method. The response from the * server will be a String that is a well-formed int */
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
