Skip to content

Sonoma 14.6.1 causing issue with httr  #752

@isaacm1994

Description

@isaacm1994

After updating to macOS Sonoma 14.6.1 on my Macbook Pro M1, I've encountered an issue with the httr package when making API requests. Specifically, the error Failed writing received data to disk/application occurs during the execution of GET requests. This problem seems to be related to the interaction between the curl and httr packages on the updated macOS version.

# Define the base API URL
api_url <- "https://api.open-meteo.com/v1/forecast"

# Function to make the API request using httr
api_request <- function() {
  # Define the parameters for the API request
  params <- list(
    latitude = 35.6895,   # Latitude for Tokyo
    longitude = 139.6917, # Longitude for Tokyo
    current_weather = "true"
  )
  
  # Make the GET request
  response <- GET(url = api_url, query = params)
  
  # Check if the request was successful
  if (status_code(response) == 200) {
    # Parse and print the content of the response
    content <- content(response, "text")
    print(content)
  } else {
    # Print the status code and an error message
    print(paste("Error:", status_code(response)))
  }
}

# Call the function to test the API
api_request()


Here is the error traceback.
Error in curl::curl_fetch_memory(url, handle = handle) :
Failed writing received data to disk/application
6.
curl::curl_fetch_memory(url, handle = handle)
5.
request_fetch.write_memory(req$output, req$url, handle)
4.
request_fetch(req$output, req$url, handle)
3.
request_perform(req, hu$handle$handle)
2.
GET(url = api_url, query = params)
1.
api_request()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions