Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to send UnityWebRequest with Date Header under webgl?

Discussion in 'Web' started by KuanMi, Jul 26, 2023.

  1. KuanMi

    KuanMi

    Joined:
    Feb 25, 2020
    Posts:
    41
    I know that setting Date is not allowed by UnityWebRequest because it is managed automatically.
    But even if I don't set the Date manually, UnityWebRequest doesn't add it automatically.

    Therefore I want to switch to other tools, such as .NET networking classes.
    But I noticed that this doesn't work in WebGL because IP Sockets cannot be manipulated directly.

    The only way I can think of at present is to customize the request through JS code in the form of jslib, but this is too troublesome.

    Is there any other feasible way?
     
  2. KuanMi

    KuanMi

    Joined:
    Feb 25, 2020
    Posts:
    41
    I apologize for my ignorance, I wrongly blamed untiy, which is Fetch's forbidden header, and has nothing to do with Unity. But what is strange that Fetch didn't automatically add Date?