Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. Development
    4. [Solved] CORS error when executed from configuration page

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Solved] CORS error when executed from configuration page

    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sonusfaber last edited by sonusfaber

      I'm trying to make http requests from adapters config page (developed with react).

      Here the http options:

      const options = {
      		method: 'post',
      		body: body,
      		logger: console,
      		// mode: 'websocket',
      		headers: {
      			Connection: 'keep-alive',
      			Accept: 'text/xml',
      			Pragma: 'no-cache',
      			SOAPAction: 'http://ws01.lom.ch/soap/listDP',
      			'Cache-Control': 'no-cache',
      			'Content-Type': 'text/xml; charset=utf-8',
      			'Content-Length': body.length,
      		},
      	};
      	try {
      		const response = await client.fetch('http://192.168.1.108/ws', options);
                       .....
      

      However I'm getting the following error message:

      Bildschirm­foto 2023-02-03 um 13.33.28.png

      The very same code works from the adapter code (main.js), without any CORS errors.

      Any ideas what I need to change when executing the code from react (adapter settings)?

      1 Reply Last reply Reply Quote 0
      • S
        sonusfaber last edited by

        Solved it myself. The configuration page is running in the browser, the adapter code itself is not. That's a separate process.

        Btw. Is is possible to delete forum posts?

        wendy2702 1 Reply Last reply Reply Quote 0
        • wendy2702
          wendy2702 @sonusfaber last edited by

          @sonusfaber only admins can delete.

          Please edit your first post and add [Solved]

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          522
          Online

          31.7k
          Users

          79.8k
          Topics

          1.3m
          Posts

          2
          3
          432
          Loading More Posts
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes
          Reply
          • Reply as topic
          Log in to reply
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          The ioBroker Community 2014-2023
          logo