КиваКит Фрагмент #7
Jan 03 2023
Подробнее о KivaKit https://state-of-the-art.org/https://www.
package com.telenav.kivakit.snippets;
import com.telenav.kivakit.core.language.trait.TryTrait;
import static com.telenav.kivakit.network.http.secure.SecureHttpNetworkLocation.secureHttpNetworkLocation;
public class Snippet7 extends BaseSnippet implements TryTrait
{
public static void main(String[] args)
{
new Snippet7().run();
}
@Override
protected Object onSnippet()
{
return secureHttpNetworkLocation("https://raw.githubusercontent.com/Telenav/kivakit/releases/kivakit-network/http/src/main/java/com/telenav/kivakit/network/http/HttpMethod.java")
.get()
.readText();
}
}
Output
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// © 2011-2021 Telenav, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
package com.telenav.kivakit.network.http;
import com.telenav.kivakit.annotations.code.quality.CodeQuality;
import com.telenav.kivakit.core.messaging.Listener;
import static com.telenav.kivakit.annotations.code.quality.Stability.STABLE_EXTENSIBLE;
import static com.telenav.kivakit.annotations.code.quality.Documentation.DOCUMENTATION_COMPLETE;
import static com.telenav.kivakit.annotations.code.quality.Testing.UNTESTED;
/**
* @author jonathanl (shibo)
*/
@CodeQuality(stability = STABLE_EXTENSIBLE,
testing = UNTESTED,
documentation = DOCUMENTATION_COMPLETE)
public enum HttpMethod
{
GET,
POST,
DELETE,
HEAD,
PUT,
CONNECT,
OPTIONS,
TRACE,
PATCH,
NULL_HTTP_METHOD;
/**
* Returns the {@link HttpMethod} for the given text
*
* @param listener The listener to notify with any problems
* @param text The text to parse
*/
public static HttpMethod parseHttpMethod(Listener listener, String text)
{
try
{
return valueOf(text.toUpperCase());
}
catch (Exception e)
{
listener.problem("Invalid HTTP method: $", text);
return null;
}
}
}
Подробнее о КиваКит
https://state-of-the-art.org/
https://www.kivakit.org/
Статьи по Теме
KivaKit Фрагмент #1
KivaKit Фрагмент #2
KivaKit Фрагмент #3
Шесть причин, почему большая часть Java, которую вы видели, не является настоящей Java
Почему хост не является строкой, а порт не целым числом
Целое число не является счетом
Все по принципу «разделяй и властвуй»

![В любом случае, что такое связанный список? [Часть 1]](https://post.nghiatu.com/assets/images/m/max/724/1*Xokk6XOjWyIGCBujkJsCzQ.jpeg)



































