Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:34:42+00:00 2026-06-14T00:34:42+00:00

How do I do an HTTP PUT request using the UrlFetch service for Google

  • 0

How do I do an HTTP PUT request using the UrlFetch service for Google App Engine’s Java runtime?

The following code in my application will send a POST request:

URL url = ...;
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setReadTimeout(MAX_TIMEOUT); // Maximum allowable timeout on GAE of 60 seconds
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "application/json; charset=utf-8");
OutputStreamWriter writer = null;
try {
    writer = new OutputStreamWriter(conn.getOutputStream(), Charset.forName("utf-8"));
    writer.write(jsonContent);
} finally {
    if (writer != null)
        writer.close();
    }
}
InputStream inStream = null;
E response = null;   // Unmarshalled using Jackson
try {
    inStream = conn.getInputStream();
    if (status != 204) { // NO CONTENT => No need to use Jackson to deserialize!
        response = mapper.readValue(inStream, typeRef);
    }
} finally {
    if (inStream != null) {
        inStream.close();
    }
}

I try doing the same as POST for PUT, but I keep on getting a 405 HTTP error for Method Not Allowed. Thanks for the help.

Reference: https://developers.google.com/appengine/docs/java/urlfetch/overview

Unfortunately, GAE Java doesn’t have as good of documentation as Python’s version of GAE URL fetch(https://developers.google.com/appengine/docs/python/urlfetch/overview). Anyone from Google wanna say why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:34:44+00:00Added an answer on June 14, 2026 at 12:34 am

    I think your code works. The HTTP 405 you are seeing is coming from the server you’re contacting (not all services support PUT). You can try using curl to hit the URL if you’d like confirmation that it’s not your code at fault:

    curl -X PUT -d "foo=bar" http://your_site.com/path/to/your/resource
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently using Inets with the following request: http:request(put, {Url, [{User-Agent, UA}, {Content-type,
I'm using jQuery.ajax() to make a PUT request to a REST web service, but
I'm using httplib and django. When I do the following: conn.request(PUT, /udj/users/3/library/songs, headers={X-Udj-Ticket-Hash :
I'm sending an HTTP PUT request from a WinForms application and I'd like to
I've written a service using HTTP PUT method for uploading a file. Web Browsers
I'm attempting to process the body of an HTTP PUT request, but it seems
I have a REST web service and android. Now I want to request Http
I get an Out of Memory Exception when using Http.Put of a large file.
I want to test my REST-Service using the RestEasy Client Framework. In my application
The device sends an HTTP PUT request to the tomcat server.And server response '200(OK)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.