junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 23 forks source link

Issues with the function of the createHttp2Request #93

Open Java-S12138 opened 2 years ago

Java-S12138 commented 2 years ago

This is an api that pick a hero in selecting hero's phase.( /lol-champ-select/v1/session/actions/1 )

Using createHttp1Request function there is no problem, and the following code.

const http1PickHero = async () => {
  const credentials = await authenticate()
  let localBody = {
    "completed": true,
    "type": 'pick',
    "championId": '157'
  }
  const response = await createHttp1Request({
    method: "PATCH",
    url: `/lol-champ-select/v1/session/actions/1`,
    body: localBody
  }, credentials)
}

But using createHttp2Request function there is problem.

No any response, also is not an error. PATCH or POST method not response, but GET have a response.

const http2PickHero = async () => {
  const credentials = await authenticate()
  const session = await createHttpSession(credentials)
  let localBody = {
    "completed": true,
    "type": 'pick',
    "championId": '157'
  }
  const response = await createHttp2Request({
    method: "PATCH",
    url: `/lol-champ-select/v1/session/actions/1`,
    body: localBody
  },session, credentials)
  session.close()
}
junlarsen commented 2 years ago

Interesting, thanks for the reporting - will investigate

borsodigerii commented 1 year ago

Any progress on this? I encountered the same problem, no error/response was given when i called createHttp2Request with method POST.

liyao1520 commented 3 weeks ago

createHttp2Request

me too