swiftype

why I can't make search request to my Elastic Enterprise Search app using axios?

馋奶兔 提交于 2021-02-10 21:25:30
问题 so I want to make search request to my elastic enterprise search app using guide from the documentation in here , I don't want to use elastic node JS client, but I want to make http request using axios. here is the code I use const url = "https://XXXXXXX38ce49e5aff1aa238e6f9195.ent-search.asia-southeast1.gcp.elastic-cloud.com/api/as/v1/engines/events/search" const headers = {"Authorization": "Bearer search-qpz4bu5o7ubb8j31r15juyrh"} const jsonData = { query: "hello there" } try { const {data}

why I can't make search request to my Elastic Enterprise Search app using axios?

萝らか妹 提交于 2021-02-10 21:21:40
问题 so I want to make search request to my elastic enterprise search app using guide from the documentation in here , I don't want to use elastic node JS client, but I want to make http request using axios. here is the code I use const url = "https://XXXXXXX38ce49e5aff1aa238e6f9195.ent-search.asia-southeast1.gcp.elastic-cloud.com/api/as/v1/engines/events/search" const headers = {"Authorization": "Bearer search-qpz4bu5o7ubb8j31r15juyrh"} const jsonData = { query: "hello there" } try { const {data}

What happens while wrapping and unwrapping an optional in Swift?

﹥>﹥吖頭↗ 提交于 2019-12-08 10:28:22
问题 When a var is marked as an optional Swift wraps it and when actual value is needed unwrapping is performed. var anOptional : String? = "wrapping" print("\(anOptional!) unwrapping") What actually happens during wrapping and unwrapping of an optional? 回答1: An Optional is an enum with two possible cases, .None and .Some . The .Some case has an associated value which is the wrapped value. To "unwrap" the optional is to return that associated value. It is as if you did this: let anOptional :