Skip to main content
Glama
SetOrientationHandler.swift732 B
import Foundation import FlyingFox import os import XCTest @MainActor struct SetOrientationHandler: HTTPHandler { private let logger = Logger( subsystem: Bundle.main.bundleIdentifier!, category: String(describing: Self.self) ) func handleRequest(_ request: HTTPRequest) async throws -> HTTPResponse { guard let requestBody = try? await JSONDecoder().decode(SetOrientationRequest.self, from: request.bodyData) else { return AppError(type: .precondition, message: "incorrect request body provided for set orientation").httpResponse } XCUIDevice.shared.orientation = requestBody.orientation.uiDeviceOrientation return HTTPResponse(statusCode: .ok) } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mobile-dev-inc/Maestro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server