Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonoma 14.6.1 causing issue with httr #752

Closed
isaacm1994 opened this issue Aug 11, 2024 · 1 comment
Closed

Sonoma 14.6.1 causing issue with httr #752

isaacm1994 opened this issue Aug 11, 2024 · 1 comment

Comments

@isaacm1994
Copy link

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()

@hadley
Copy link
Member

hadley commented Oct 21, 2024

We haven't heard widespread problems about this, so unfortunately it's probably an issue specific to your computer.

@hadley hadley closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants