0

I am doing a post request on http://115.240.101.71:8282/CampusPortalSOA/.. My problem is i cant access the jession cookie from header. so i cant send it to got further details. How to send and save received cookies?

const options = {
      method: "POST",
      headers: {
        "Content-Type": "application/json; charset=utf-8",
      },
      body: '{"username":"2241003050","password":"2241003050","MemberType":"s"}',
    };

    await fetch("http://115.240.101.71:8282/CampusPortalSOA/login", options)
      .then((response) => response.json())
      .then((response) => console.log(response))
      .catch((err) => console.error(err));
  };
const options = {
      method: "POST",
      headers: {
        "Content-Type": "application/json; charset=utf-8",
      },
    };

    fetch("http://115.240.101.71:8282/CampusPortalSOA/studentinfo", options)
      .then((response) => response.json())
      .then((response) => console.log(response))
      .catch((err) => console.error(err));
  };

in here i only get empty object as response. It works fine in rapidAPI & Thunder Client.

i am trying to get the studentinfo but for that i need to pass the jsession cookies that received while login request done. As i cant find the jsession cookies or dont know how to save and send cookies automatically.

James Z
  • 12,209
  • 10
  • 24
  • 44

0 Answers0