পোস্ট: প্যাচ

অনুমোদন প্রয়োজন

পোস্ট আপডেট করে। এই পদ্ধতিতে প্যাচ সিম্যান্টিক্স কাজ করে। এখনই এটি ব্যবহার করে দেখুন অথবা একটি উদাহরণ দেখুন।

অনুরোধ করুন

HTTP অনুরোধ

PATCH https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId

প্যারামিটারগুলি

প্যারামিটারের নাম ভ্যালু বিবরণ
প্রয়োজনীয় প্যারামিটার
blogId string ব্লগের আইডি।
postId string পোস্টের আইডি।

অনুমোদন

এই অনুরোধের জন্য নিম্নলিখিত স্কোপের মধ্যে অন্তত একটির সাথে অনুমোদন প্রয়োজন (যাচাইকরণ এবং অনুমোদন সম্পর্কে আরও পড়ুন)।

সুযোগ
https://www.googleapis.com/auth/blogger

অনুরোধের বডি

অনুরোধের প্রধান অংশে, একটি পোস্ট রিসোর্স প্রদান করুন।

রেসপন্স

সফল হলে, এই পদ্ধতি রেসপন্স বডিতে পোস্ট রিসোর্স ফিরিয়ে দেয়।

উদাহরণ

মনে রাখবেন: এই পদ্ধতির উদাহরণ হিসেবে যে কোড উপলভ্য রয়েছে তা সব কার্যকরী প্রোগ্রামিং ল্যাঙ্গোয়েজের বর্ণনা করে না (কোন কোন ল্যাঙ্গোয়েজ এতে কাজ করে তার সম্পূর্ণ তালিকা দেখার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।

Java

Java ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

// The BlogId of a test blog.
String TEST_BLOG_ID = "8070105920543249955";

// The PostId of a post.
String POST_ID = "4883581657838685651";

// Configure the Java API Client for Installed Native App
HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();

// Configure the Installed App OAuth2 flow.
Credential credential = OAuth2Native.authorize(HTTP_TRANSPORT,
JSON_FACTORY, new LocalServerReceiver(),
Arrays.asList(BloggerScopes.BLOGGER));

// Construct the Blogger API access facade object.
Blogger blogger = Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY)
.setApplicationName("Blogger-PostsPatch-Snippet/1.0")
.setHttpRequestInitializer(credential).build();

// Construct the patch
Post patch = new Post();
patch.setId(Long.parseLong(POST_ID));
patch.setContent("With really <emph>exciting</emph> <code>HTML</code> content");

// The request action.
Patch postsPatchAction = blogger.posts().patch(TEST_BLOG_ID, POST_ID, patch);

// Restrict the result content to just the data we need.
postsPatchAction.setFields("author/displayName,content,published,title,url");

// This step sends the request to the server.
Post post = postsPatchAction.execute();

// Now we can navigate the response.
System.out.println("Title: " + post.getTitle());
System.out.println("Author: " + post.getAuthor().getDisplayName());
System.out.println("Published: " + post.getPublished());
System.out.println("URL: " + post.getUrl());
System.out.println("Content: " + post.getContent());

এটি ব্যবহার করে দেখুন!

লাইভ ডেটাতে এই পদ্ধতি কল করতে এবং উত্তর দেখতে নিচে দেওয়া APIs Explorer ব্যবহার করুন।