org.restlet.Request.setReferrerRef()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.restlet.Request.setReferrerRef方法的一些代码示例,展示了Request.setReferrerRef的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setReferrerRef方法的具体详情如下:
包路径:org.restlet.Request
类名称:Request
方法名:setReferrerRef

Request.setReferrerRef介绍

[英]Sets the referrer reference if available using an URI string. Note that when used with HTTP connectors, this property maps to the "Referer" header.
[中]使用URI字符串设置引用者引用(如果可用)。请注意,当与HTTP连接器一起使用时,此属性映射到“Referer”头。

代码示例

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the referrer reference if available.
 * 
 * @param referrerRef
 *            The referrer reference.
 */
@Override
public void setReferrerRef(Reference referrerRef) {
  getWrappedRequest().setReferrerRef(referrerRef);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the referrer reference if available using an URI string.
 * 
 * @param referrerUri
 *            The referrer URI.
 * @see Request#setReferrerRef(String)
 */
public void setReferrerRef(String referrerUri) {
  getRequest().setReferrerRef(referrerUri);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the referrer reference if available using an URI string.
 * 
 * @param referrerUri
 *            The referrer URI.
 */
@Override
public void setReferrerRef(String referrerUri) {
  getWrappedRequest().setReferrerRef(referrerUri);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the referrer reference if available.
 * 
 * @param referrerRef
 *            The referrer reference.
 * @see Request#setReferrerRef(Reference)
 */
public void setReferrerRef(Reference referrerRef) {
  getRequest().setReferrerRef(referrerRef);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the referrer reference if available using an URI string. Note that
 * when used with HTTP connectors, this property maps to the "Referer"
 * header.
 * 
 * @param referrerUri
 *            The referrer URI.
 * @see #setReferrerRef(Reference)
 */
public void setReferrerRef(String referrerUri) {
  setReferrerRef(new Reference(referrerUri));
}

代码示例来源:origin: stackoverflow.com

Form form = new Form();
form.add("foo", "bar");
form.add("abc", "123");

Request request = new Request(Method.POST, "http://host/path/to/resource");

request.setEntity(form.getWebRepresentation());

request.setReferrerRef("http://host/path/to/referrer");

Response response = client.handle(request);

相关文章