<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: There is no way to modify network request in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1325210#M220</link>
    <description>&lt;P&gt;Yes, with 200.2.0 we added support for network interceptors, but at this point only for "observational" purposes such as logging network requests. We are currently working on support for modifying network requests as part of network interception. This will be supported in one of the upcoming releases.&lt;BR /&gt;&lt;BR /&gt;Note, if you are interested in adding headers on every outgoing network request, you can currently do this with &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.httpcore/-arc-g-i-s-http-client/add-additional-request-header.html" target="_self"&gt;ArcGISHttpClient.addAdditionalRequestHeader&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2023 13:16:54 GMT</pubDate>
    <dc:creator>GuntherHeppner</dc:creator>
    <dc:date>2023-09-04T13:16:54Z</dc:date>
    <item>
      <title>There is no way to modify network request</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1325188#M219</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Context&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Starting with Kotlin SDK &lt;STRONG&gt;200.2&lt;/STRONG&gt; there is ability to add http network (application level) interceptor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;There is no way to modify a request from the chain – there is no builder for it and `Request.Builder()` will cause exception (as it doesn't have okhttp delegate inside).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sample code&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;ArcGISEnvironment.configureArcGISHttpClient &lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    interceptor &lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;val &lt;/SPAN&gt;originalRequest = it.request()&lt;BR /&gt;        &lt;SPAN&gt;// val newRequest = originalRequest.newBuilder() &amp;lt;-- no API for this op&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        // it.proceed(newRequest) // so we can't e.g. add/remove header&lt;BR /&gt;&lt;/SPAN&gt;        it.proceed(originalRequest)&lt;BR /&gt;    &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 Sep 2023 10:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1325188#M219</guid>
      <dc:creator>dev4567</dc:creator>
      <dc:date>2023-09-04T10:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: There is no way to modify network request</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1325210#M220</link>
      <description>&lt;P&gt;Yes, with 200.2.0 we added support for network interceptors, but at this point only for "observational" purposes such as logging network requests. We are currently working on support for modifying network requests as part of network interception. This will be supported in one of the upcoming releases.&lt;BR /&gt;&lt;BR /&gt;Note, if you are interested in adding headers on every outgoing network request, you can currently do this with &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.httpcore/-arc-g-i-s-http-client/add-additional-request-header.html" target="_self"&gt;ArcGISHttpClient.addAdditionalRequestHeader&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 13:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1325210#M220</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2023-09-04T13:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: There is no way to modify network request</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1334040#M235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46685"&gt;@GuntherHeppner&lt;/a&gt;&amp;nbsp;, It’s good to hear ArcGIS is gonna support modify request so that we could make the request through internal proxy.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you help to give a estimation for the date of next ArcGIS release so that I could plan for my project&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 03:50:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1334040#M235</guid>
      <dc:creator>KhiemLq</dc:creator>
      <dc:date>2023-10-02T03:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: There is no way to modify network request</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1334171#M236</link>
      <description>&lt;P&gt;The issue with `addAdditionalRequestHeader` is it do &lt;STRONG&gt;adds&lt;/STRONG&gt; a header, so there is no way to overwrite the existing one – this is quite critical when e.g. we use own proxy for authorization and every time the auth token expires we have to provide a new header, but the proxy server still expects sole auth header and just uses the first one available (with already expired token).&lt;/P&gt;&lt;P&gt;So we need either interception-with-change-request mechanism or something like `ArcGISHttpClient.removeAdditionalRequestHeader`.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 15:48:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1334171#M236</guid>
      <dc:creator>dev4567</dc:creator>
      <dc:date>2023-10-02T15:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: There is no way to modify network request</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1408522#M394</link>
      <description>&lt;P&gt;We just released ArcGIS Maps SDK for Kotlin 200.4.0, which supports modification of network requests (headers and parameters) during network request interception, more details &lt;A href="https://developers.arcgis.com/kotlin/release-notes/release-notes-for-200-4/#network-interception" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 14:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/there-is-no-way-to-modify-network-request/m-p/1408522#M394</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2024-04-11T14:33:18Z</dc:date>
    </item>
  </channel>
</rss>

